Re: Field1 controls what is displayed in Field2
- From: John W. Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 01 May 2007 23:17:00 -0600
On 1 May 2007 15:14:31 -0700, cpocpo@xxxxxxxxxxx wrote:
Hello,
I asked this awhile back, but am still unsure of what to do:
Is there anyway to have the Field2 automatically entered in the table
when the value for Field1 is selected in the combo box on the form??
Yes; but in a properly designed database it should almost NEVER be necessary
to do so. A field should depend only on the Primary Key of its table; here
you're talking about two fields which depend upon each other.
In other words, on the form, select "Paperclip" using a combobox which
is tied to Field1. In the next field2 is a listbox (or combo,
whichever works) that would change to say "Part 06207". (It would be
grayed out so no data entry happens there by the user.)
Select "Stapler" in Field1 and field2 changes to "Part 099A"
Why not simply use a Combo Box based on a Parts table? Store the part number
in the table when you select Stapler or Paperclip from the combo. If you wish,
you can *DISPLAY* (without storing) the part name in a textbox: set its
control source to
=cboPartNumber.Column(1)
to display the second (it's zero based) column of the combo's row source
query.
BTW, is there a site somewhere where we can share Access files so that
I can just modify someone else's format, or they can modify mine
instead of reinventing the wheel everytime??
Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html
The Access Web resources page:
http://www.mvps.org/access/resources/index.html
John W. Vinson [MVP]
.
- References:
- Field1 controls what is displayed in Field2
- From: cpocpo
- Field1 controls what is displayed in Field2
- Prev by Date: RE: Field1 controls what is displayed in Field2
- Next by Date: RE: Run Data Base Application
- Previous by thread: RE: Field1 controls what is displayed in Field2
- Next by thread: Re: Option Group Choice Hiding Tabs Help
- Index(es):
Relevant Pages
|