By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

How do you "look up" a value in an access subform?

P: n/a
Lets say I have a form called Planet_Systems and a form called
Species. I then want to link the primary key "Planet" to bring up
it's various species in the corresponding subform. So, I created a
subform species within the forum Planet_Systems. They're linked
properly and related etc.. I typed into the Planet combobox: "Earth".
I would now like for all of the different Species found on Earth to be
listed in the subform automatically once I click on a button in the
main form or something. I guess it's sort of a lookup or requery
function but I'm not too sure. Any experienced Acces users know what
I'm trying to do here?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In your sci-fi example, there would be a many-to-many relationship between
Planets and Species, i.e.:
- one planet has many speicies, but also:
- one species can appear on many planets.

You need 3 tables to handle this relation:
- tblPlanet, with PlanetID primary key;
- tblSpecies, with SpeciesID primary key;
- tblPlanetSpecies: one record for each combination, with foreign keys
PlanetID and SpeciesID.

The subform would be bound to tblPlanetSpecies, with a combo box to select
the species.

For another example and more detail, see:
http://allenbrowne.com/casu-06.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alienz" <ks*****@yahoo.com> wrote in message
news:58*************************@posting.google.co m...
Lets say I have a form called Planet_Systems and a form called
Species. I then want to link the primary key "Planet" to bring up
it's various species in the corresponding subform. So, I created a
subform species within the forum Planet_Systems. They're linked
properly and related etc.. I typed into the Planet combobox: "Earth".
I would now like for all of the different Species found on Earth to be
listed in the subform automatically once I click on a button in the
main form or something. I guess it's sort of a lookup or requery
function but I'm not too sure. Any experienced Acces users know what
I'm trying to do here?

Nov 12 '05 #2

P: n/a
Well I would like the subform to actually bring up its 1st entry based
on the primary key in the main form...and then to be able to scroll
through the subform values so its a bit different. Dont know what time
it is in Au. Thanks for your help and if you have any more suggestions
pls reply when you can! The way Im doing it now the subform values are
associated with the main form but I have to create a new entry and then
go back to view the associated subform entries. The subform is not
populated immediately once I enter a value into the main form primary
key. Im trying some things like maybe a call function but its not
working because the subform has several values and I guess I want it to
jump to the 1st.
I explained it a little more here:
http://groups.google.ca/groups?q=kst...8&selm=58e54da
4.0405192038.49aa1d72%40posting.google.com&rnum=2

But no one could answer that post :(
Btw, is it winter in Australia now.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.