Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

Datasheet subform--filter one combo box based on another not working

Question posted by: WyvsEyeView (Member) on July 24th, 2008 10:12 PM
I am doing the very standard thing of filtering the contents of one combo box based on another combo box. I've done it many times, but always on a main form. Now I'm trying to do it on a datasheet subform and it is not working. After making the selection in the first combo box, when I move to the second combo box, I get the Access input parameters box. If I input the value that is in the first combo box, I get the expected results in the second combo box, so clearly, the second box simply cannot read the data that is in the first one. When I turn this datasheet subform into a main standalone form, everything works correctly, so it is the datasheet/subform aspect that is tripping me up.

I can provide the exact queries if necessary but it seems like there must be a standard trick or workaround that you could quickly turn me onto. Thanks for your help.
nico5038's Avatar
nico5038
Moderator
2,064 Posts
July 25th, 2008
05:40 AM
#2

Re: Datasheet subform--filter one combo box based on another not working
Check out:
http://www.mvps.org/access/forms/frm0031.htm

You'll need to add ".form." to your field reference...

Nic;o)

Reply
WyvsEyeView's Avatar
WyvsEyeView
Member
40 Posts
July 25th, 2008
02:30 PM
#3

Re: Datasheet subform--filter one combo box based on another not working
Thank you. I am familiar with this paradigm but because I am putting the code behind the subform itself and not behind the main form, I did not think I needed to use these conventions. All the code is referring to the same form that it is behind. Do I need to put it behind the main form instead? The main form is basically blank...it's just a "holder" for the subform.

Reply
nico5038's Avatar
nico5038
Moderator
2,064 Posts
July 25th, 2008
05:00 PM
#4

Re: Datasheet subform--filter one combo box based on another not working
The reference is needed because the subform is on a "lower" level.
You stated "I get the Access input parameters box", this implies that Access can't find the mentioned field or you made a typo..

Can you post the query text of the second combobox ?

Nic;o)

Reply
WyvsEyeView's Avatar
WyvsEyeView
Member
40 Posts
July 25th, 2008
10:24 PM
#5

Re: Datasheet subform--filter one combo box based on another not working
I have the filtering working now. I had to use the Forms!Mainform!Subform.Form!ControlName syntax in the query but it is working. I would never have thought so. Live and learn :) Thanks for your help!

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,071 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft Access / VBA Forum Contributors