Display query results in a dialogbox

sakthivels

Beginner 2 Intermediate
Local time
Today, 15:18
Joined
Jun 3, 2009
Messages
23
Hi,

I have a form where I collect data which is used to find whether a record exists for the criteria. I use the dlookup to do this. Now I want to know whether I can display the results of a select query in a dialog box for the criteria.

Example in a SalesOrder Table, there are many records with the value Paper Rolls, Pencils, etc., Now I use the form to find whether the record exists for "Paper", Once the record is found, I want to display all records that match "Paper" in a dialog box.

Kindly someone guide me on how to do this.

Regards,
Sakthivel
 
sakthivels,

You keep refering to a dialog box. Do you really mean a List Box?

Using Dlookup is not the best method to determinge if there are records that match a specific criteria. Dcount can be used or you can simple use an SQL statement that counts the records that meet the criteria. The you check the count to see if it is greater than zero.

If it is a list box you really want, then you can display the results of a select type query using the same criteria that you use for returning your count of the records.

HTH
 
Respecred Mr.B,

I am developing a Customer Detail Collection Application where I collect the details like Name, Address, Contact Numbers. The criteria for this form is as follows.

Each member of the family will have a common number with a differential suffix. Say for instance Father will have a Client ID like XX-YYYYYY-01, and the son will have a Client ID like XX-YYYYYY-02, where the last two digits are used for differention. Suppose when another Customer is added his Client ID will be XX-ZZZZZZ-01, and his son will have ID as XX-YYYYYY-02 and goes on like this.

Whenever a new client is to be added I popup a form with the options, "New Client New Family" and "New Client Existing Family". So when the "New Client New Family" option is selected I just assign the next available Client ID, ie I increment the middle part by 1 and the default suffix as 01. When the "New Client Existing Family" is selected I ask the user to type in the existing Client ID or the contact number and do a search on the detail. Once a record is found, I want to display the Client ID, Address, Contact Numbers in a dialog box or say a list box, just to confirm whether the new Client is to be added under the existing ID.

I am just confused how can I do this, Whether to write a new query and display the results in a new window or I can use the list box for displaying the details or display the information in a dialog box.

All I want is the user to confirm whether the new Client is to be added for the given criteria.

Please advise me on this.
Regards,
Sakthivel.
 
I think I would use a new popup form with button to confirm of deny the use of that prior client. You would have the necessary fields on that form to display the current data, not a "dialog box" or a list box.

You can link this new popup form to a query.
 
Mr. B,

Thanks for the tip. Let me try and get back to you.

Regards,
Sakthivel
 

Users who are viewing this thread

Back
Top Bottom