Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo2 depends on Combo1 ... On Open, user prompted for Combo1 value

Status
Not open for further replies.

josephwalter

Programmer
Sep 16, 2002
80
US
I've got two Combo Boxes on my data entry form. The value selected from the first will limit the choices in the second combo box. Combo2's Row Source uses the values of Combo1 as a criteria.

When I open the form, Access prompts me for the value of Combo1 (understandably - the form's not open yet, and it's trying to fill Combo2 with the appropriate values).

Is there a way I can suppress / work around this ... perhaps an OR criteria in Combo2's Row Source?

Combo2 should have no values in it when the form is opened (I take care of requerying it when Combo1's value changes and in the On Current event).
 
Build the RowSource sql of combo2 only in the event procedures.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I need to do the same but I am having difficulty with the requerying of Combo 2. Can either of you help with a little snipit of code on how to requery when combo 1 changes?


cboPri = Primary Failure = Combo 1
cboSec = Secondary Failure = Combo 2

Thanks in advance!
 
Nevermind guys . . . I did some more searching and found enough to get it too work.

me.cbosec.requery on the change event of combo 1
 
PHV -

Thank you for your reply. I discovered that I had the name wrong in the criteria in the query for Combo2 - instead of referencing F_ProcessInfo.Combo1, I had frmProcessInfo.Combo1. I had changed the form name's prefix from F_ to frm. The autoname/autocorrect feature didn't catch the changed, I guess.

The form worked fine once I got the name right!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top