Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Queries and Input Boxes

Phil1981Phil1981 Member Posts: 26
I am creating an application for college were i have to create a simple front end for a simple access database.

I need help when creating queries. I have a data control on my page that access's the Customer Table in my database. I want to allow a input box to appear that allows the user to enter the search criteria that they want i.e. a surname.

i know you create queries like this

datCustomers.RecordSource = "Select [Customer Details].* From [Customer Details] where Surname...............

and the message box looks something like

Dim criteria As String
Dim msg As String

msg = "Please Enter the Surname to Search For below : "
criteria = InputBox(msg, "Enter Search Criteria")

but how do i get the input from the input box in to this sql statement that then searches for the criteria entered.



  • SanganakSakhaSanganakSakha Member Posts: 8
    Hello Phil1981,

    Have look at the following Microsoft Access on-line help topic:

    Create a parameter query that prompts for criteria each time it's run
    It starts with:
    A parameter query displays one or more predefined dialog boxes that prompt you for the parameter value (criteria). You can also create a custom dialog box that prompts for the query's parameters.

    I would be glad to provide any more help you may need in this regard.

    with best compliments,

    Your Friend In Need.

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _____ [ ] free ebooks and video tutorials about { Perl, PHP, Objective-C, Java, C#, Scratch, Visual Basic, PL/SQL, C++, R, Swift, Assembly, Delphi, C, Go, MATLAB, Ruby, Python, JavaScript, Visual Basic .NET Alice, Logo, Bash, VBScript, LabVIEW, Clojure, Lua, Scala, FoxPro, ML, ABAP, Lisp, Hack, Transact-SQL, Apex, Awk, Rust, Crystal, Ada, Julia, F#, Erlang, Fortran, D, Scheme, Prolog, SAS, Dart, Kotlin, COBOL } _________

Sign In or Register to comment.