Results 1 to 2 of 2

Thread: Parameter Query

  1. #1
    Join Date
    Jun 2010

    Unanswered: Parameter Query

    I've created a query that requires you to enter a parameter value to search for a particular record in a table.

    This query, when run, pops up a message box that asks you to enter the Product_ID of the particular product. After entering the ID and clicking on the button, the corresponding record to the product ID entered, is displayed.

    I was wondering..
    Let's say I've got 20 records in the table. So there'll 20 customer IDs.
    So what if the user enters the non-existent customer Id, for e.g. 40. But there is no such record with that customer Id. I would like the program to detect this error and display a message box, 'Customer_ID entered is not valid'.

    Is this possible?

    My current query design is like this...

    FIELD: Customer_ID | Customer_name | Customer_address
    Table: T_Customer | T_Customer | T_Customer
    Sort: (I did not enter any data in this column)
    Show: (I ticked all the boxes)
    Criteria: [Please Enter the Customer_ID of the required customer]
    or: (no data entered)
    Last edited by Jesnie; 06-23-10 at 11:26.

  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    This is one of the reasons most of us use forms to gather user input. You can validate what the user enters before running the following process. In this case, I'd use a combo box that got it's values from your customer table. That way, the user can only select a valid customer number.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts