A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Triggering a Query



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2008, 07:25 PM posted to microsoft.public.access.gettingstarted
down in flames
external usenet poster
 
Posts: 8
Default 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  
Old December 3rd, 2008, 04:06 PM posted to microsoft.public.access.gettingstarted
down in flames
external usenet poster
 
Posts: 8
Default 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  
Old December 3rd, 2008, 05:09 PM posted to microsoft.public.access.gettingstarted
Ron2006
external usenet poster
 
Posts: 936
Default 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  
Old December 3rd, 2008, 05:12 PM posted to microsoft.public.access.gettingstarted
Ron2006
external usenet poster
 
Posts: 936
Default 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  
Old December 3rd, 2008, 10:07 PM posted to microsoft.public.access.gettingstarted
down in flames
external usenet poster
 
Posts: 8
Default 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  
Old December 4th, 2008, 04:50 PM posted to microsoft.public.access.gettingstarted
Ron2006
external usenet poster
 
Posts: 936
Default 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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.