Windows XP Filtering on Subforms

Joined
Sep 29, 2005
Messages
4
Reaction score
0
Ok. I have a problem. I have a subform that is linked to a main for by a unique key.

Within the subform, I have two combo boxes and I want one to filter based upon the input of the other. I developed a query for the second combo box which says:

SELECT dbo_DriverCons.DriverNo, dbo_DriverCons.CityCode
FROM dbo_DriverCons
WHERE (((dbo_DriverCons.CityCode)=[forms]![F affiliate quotes]![city]));


Then I created a 'Refresh Macro' on the GotFocus Event of the 2nd combo box. It works perfectly fine when I just open the subform on it's own, but it doesn't work when I open the main form. Must I make a visual basic routine in order to get this thing to work?

If you have an answer and post it here, please e-mail me at

(e-mail address removed) as I'm trying to finish this project today and this is one of my last hold-ups.

thanks,

don
 
Joined
Sep 29, 2005
Messages
4
Reaction score
0
Well, In really searching for an answer to this question I have seen that others have asked similar questions without getting an answer.

Logically, I'm trying to figure out why it won't work on the parent form but will work if I open the subform on its own. I'm really hoping that someone has encountered this before and can help. Are the spaces within my form name "F Affiliate Quotes" causing problems?

Ugh..and I thought this was going to be easy.
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,742
Reaction score
1,207
Sorry, I'm afraid you lost me ... don't give up. ;)
 
Joined
Sep 29, 2005
Messages
4
Reaction score
0
Ok let me try again.



I have a form that has a unique Identifier, EventCode. I have two other tables which also have this eventcode, but have more detail. I have built-in a one-to-many relationship between the 3 tables (it's actually two tables 1 Form, and 2 Subforms filtered by my own specs)

In one of these subforms, I have another unique code called citycode. Each city has various drivers, literally people who drive vehicles, assigned to them. Thus, when I select a city in my Combo box, I only want to have the option to, in the next combo box, select drivers associated with that city code.

Again, if I open the subform on its own, the combo box works. I'm using a SQL query and saying forms!subformname!citycode and filtering for records that match the citycode within the first combo box.

The problem comes when I open the main form. The combo connection doesn't work. Instead, when I click on the second combo box it gives me the message "forms!subformname!citycode" where I need to enter something. In other words, it's not recognizing that the combo is already open, I guess.

I don't know what to do, and have been looking all day for an answer with not much luck.
 
Joined
Sep 29, 2005
Messages
4
Reaction score
0
have received no help on this.

I created some bootleg macros as a work around, but it still isn't perfect.

Is there really no solution?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top