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...
I want to create a Form where I can input the Primary Key values to query
the Form to
show the 13 fields assigned to the Primary key pair. If I create 2 Combo
boxes I can only
get the see the assignments for the first Primary Key, or only for the
second Primary Key.
I can't see how to get the lookup to use both Primary Keys.
appreciate any help
Jim 2 1992
"jim" <ji*****@yahoo.com> 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 Key
or one Primary Key. What you describe is a multi-field Primary Key, that is,
a single Primary Key composed of two Fields.
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 Box.
In the AfterUpdate event of the second Combo Box, use the contents of both
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
I want to create a Form where I can input the Primary Key values to query the Form to show the 13 fields assigned to the Primary key pair. If I create 2 Combo boxes I can only get the see the assignments for the first Primary Key, or only for the second Primary Key. I can't see how to get the lookup to use both Primary Keys.
appreciate any help Jim
"Larry Linson" <bo*****@localhost.not> wrote in message
news:JnUWf.16905$W75.4526@trnddc07... "jim" <ji*****@yahoo.com> 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
Key or one Primary Key. What you describe is a multi-field Primary Key, that
is, a single Primary Key composed of two Fields.
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
Box. In the AfterUpdate event of the second Combo Box, use the contents of both 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
Thanks for the help.
Some of what you say is new to me, I will try to work thru it.
Thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: FZ |
last post by:
Hi Gang,
I was wondering if a generous person might be able to walk me
through what I believe is a pretty simple task. I actually have...
|
by: Krisa |
last post by:
Hello all,
I just discovered something (stop me if you've heard this before....) that
was causing me a significant performance hit when opening a...
|
by: Robert Neville |
last post by:
The solution to my dilemma seems straight-forward, yet my mind has not
been forthcoming with a direct route. My Project form has a tab
control with...
|
by: RBohannon |
last post by:
I'm using Access 2000.
I currently have a report being generated using the results of a query
by form. The form used for this query is an...
|
by: Andrew |
last post by:
Hello,
I am trying to create a chart whose underlying query is linked to 2
combo boxes on the same form.
I want to pass the values from the...
|
by: meganrobertson22 |
last post by:
Hi Everyone-
I have a question about how to add and then use the "All" selection in
a combo box. I am trying to figure out how to:
(1) add...
|
by: visionstate |
last post by:
Hi there,
I am working on a form that uses 3 text boxes and 3 combo boxes.
When any data is entered into any of these, I click a command button...
|
by: jjyconsulting |
last post by:
Newbie needing some help. I have a tblParticipants. The fields
include gender, education_level, income, occupation etc., I'm trying to
create a...
|
by: Rabbit |
last post by:
Cascading Combo/List Boxes
This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list...
|
by: Del |
last post by:
Hello and thanks for any and all assistance!
I have a database that is used by several users on several different
machines.
The backend database...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...
| |