Query Different criteria

JPR

Registered User.
Local time
Today, 05:49
Joined
Jan 23, 2009
Messages
204
Hello,

I have a form with a combo and a list box.

The combo gets its data from TABLEA in which I have used a list of records which will be used as a query criteria.

The listbox has its record source in TABLEB and is populated after the AfterUpdate event of the Combo. The records I am searching in TABLEB have a different name comparted to the ones listed in the combo.

Is there a way I can use the combo as query criteria with records different from the ones in the table I am searching?

Examples: If I select from the combo the records Suspended, then the query should look for those records named S in Table B.

THank you
 
the combo box should have 2 columns
CAPTION, QRY

the user can see col 1, 'Suspended'
the combo bound col = 2 gets the query , 'qsSuspended"
(hide col 2 by setting col widths : 1;0 )

the combo afterupdate event assigns the query to the listbox
Code:
sub cboBox_Afterupdate()
   lstBox.rowsource = cboBox
end sub
 
Thank you for your quick reply. Since I am still having a problem I am attaching a very simple example of my db.
You will notice that the cbo has different selections. All refer to a different criteria, in the same query. Each criteria will search in a different field.

Thank you.
 

Attachments

Look up the topic "Cascading combo boxes" which is a way to dynamically adjust what your form sees based on selections in a combo box. This forum should have dozens of articles on that subject.
 

Users who are viewing this thread

Back
Top Bottom