If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Triggering a Query
I have set up a form with 3 cascading drop downs to select vehicle make,
vehicle model, and vehicle year. Each make/model/year combination was assigned an autonumber value called VINmaster. I have the 3 drop downs functioning correctly via afterevent, but now what I want to do is associate the end-users selection to the VINmaster number then use that number to display products associated with that vehicle. I assume this would be done with queries, but I have 2 questions: 1) How can I associate what was selected in the combo-boxes to the VINmaster key in tblVehicleInfo? 2) Then once this is achieved, can this be used to trigger multiple queries for different products or should one query be able to display different products in different areas on a form? Thanks! |
#2
|
|||
|
|||
Triggering a Query
Ok, I think I got question number one under control, I just changed the
Column count property to 2 and pulled VINMaster with the rowsource. Now I just cant figure out how to use this number to display the related products. "down in flames" wrote: I have set up a form with 3 cascading drop downs to select vehicle make, vehicle model, and vehicle year. Each make/model/year combination was assigned an autonumber value called VINmaster. I have the 3 drop downs functioning correctly via afterevent, but now what I want to do is associate the end-users selection to the VINmaster number then use that number to display products associated with that vehicle. I assume this would be done with queries, but I have 2 questions: 1) How can I associate what was selected in the combo-boxes to the VINmaster key in tblVehicleInfo? 2) Then once this is achieved, can this be used to trigger multiple queries for different products or should one query be able to display different products in different areas on a form? Thanks! |
#3
|
|||
|
|||
Triggering a Query
Depending on how your forms are arranged:
1) Create a subform with parent/child (master/child) linkage pointing to that field. Even if the wizard won't run for that linkage you can type the field names in manually and it works just fine. OR 2) Create a subform with a query that has criteria pointing to that field and in the afterupdate event of the combo do a re-query of that subform. Ron |
#4
|
|||
|
|||
Triggering a Query
More considerations:
Prior suggestions will work IF the bound field is the VINMaster number you talked about. If it is NOT the bound field then create another txt box on your form that is invisible and in the afterupdate event of the combo box do me.hiddentxtboxname = me.comboname.column(1) and then do either of the prior suggestions but point them to this hiddentxtboxname instead of the comboboxname. Ron |
#5
|
|||
|
|||
Triggering a Query
Thanks for the reply- What I tried doing was creating the subform linked to a
query. What happens is that the data in the subform does not change but if I go thru the drop downs then manually open the query it displays the correct data (only in the query). I am obviously overlooking something in the properties. Also, is it possible to get the subform to keep the design view formatting and not display as a datasheet? While I was trying to figure out what I was doing wrong, I tried using the dropdowns to display the results as a report instead and it worked fine. "Ron2006" wrote: Depending on how your forms are arranged: 1) Create a subform with parent/child (master/child) linkage pointing to that field. Even if the wizard won't run for that linkage you can type the field names in manually and it works just fine. OR 2) Create a subform with a query that has criteria pointing to that field and in the afterupdate event of the combo do a re-query of that subform. Ron |
#6
|
|||
|
|||
Triggering a Query
This part is easiest:
Also, is it possible to get the subform to keep the design view formatting and not display as a datasheet? In design view, go to the form properties format tab default view and change it to single or continuous for it to show as you have it designed. If it is set as datasheet it will look like a spreadsheet. On the other problem, are you doing the following me.subformname.requery in the afterupdate event of the dropdowns. That is what is necessary if the parent/master child linkage is not present. The subform should be already open on the main form where you have the combo boxes. Ron Ron |
#7
|
|||
|
|||
Triggering a Query
|
Thread Tools | |
Display Modes | |
|
|