Re: Combo boxes for Form Query
- From: "jim" <jimwmct@xxxxxxxxx>
- Date: Thu, 30 Mar 2006 21:08:12 -0800
"Larry Linson" <bouncer@xxxxxxxxxxxxx> wrote in message
news:JnUWf.16905$W75.4526@xxxxxxxxxxx
Key
"jim" <jimwmct@xxxxxxxxx> wrote
>I have created a Table that has 13 fields
> and 2 Primary Keys, e.g. 60 1, 60
> 2, ... 60 28, 61 1, 61 2, ... 61 28, etc...
Just for the record <pun intended>, a Record can have either no Primary
or one Primary Key. What you describe is a multi-field Primary Key, thatis,
a single Primary Key composed of two Fields.Box.
Create an unbound Combo Box, showing all the values of the first Field of
your Primary Key. Create a second unbound Combo Box, with a query for Row
Source that uses the first Combo Box value as criteria for that Field, and
shows the values of the second Field of the Primary Key to be selected. In
the After Update event of the first Combo Box, Requery the second Combo
In the AfterUpdate event of the second Combo Box, use the contents of bothThanks for the help.
Combo Boxes to construct the WHERE clause, or WhereContition argument of a
DoCmd.OpenForm (or DoCmd.OpenReport).
In my "linked Combo Box searches" I set the Enabled property of the second
Combo Box to No in Design View, and enable it in code in the AfterUpdate
event of the first Combo, just prior to Requerying. That prevents the user
from entering the second Field first and causing confusion (though if you
are careful, you can make it work "going either way").
Larry Linson
Microsoft Access MVP
Some of what you say is new to me, I will try to work thru it.
Thanks
.
- References:
- Combo boxes for Form Query
- From: jim
- Re: Combo boxes for Form Query
- From: Larry Linson
- Combo boxes for Form Query
- Prev by Date: Re: access report to pdf
- Next by Date: need replacement for DLookup in UPDATE query
- Previous by thread: Re: Combo boxes for Form Query
- Next by thread: Change Table Field Lookup Properties in Code?
- Index(es):
Relevant Pages
|