Queries and Input Boxes - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Queries and Input Boxes

Phil1981Phil1981 Posts: 26Member
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.


Thanks

Comments

  • SanganakSakhaSanganakSakha Posts: 8Member
    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,

    SanganakSakha.
    Your Friend In Need.


Sign In or Register to comment.