Re: Field1 controls what is displayed in Field2



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]
.



Relevant Pages

  • Re: Converting Numerical Value to Lookup value
    ... Are FMonth and EMonth unbound text boxes on the form that you want to ... display the French/English names of the months when a month is selected ... It doesn't apply to text boxes. ... If the combo box is named "cboMonth", then the control source for FMonth ...
    (microsoft.public.access.forms)
  • RE: Making one field on a form dependent on another fields results
    ... use an AutoNumber field type for the primary key. ... If your customer changes their name or address, ... > ColumnWidths How much horizontal space to allow for display of the column. ... > textbox with its control source set to the Position field. ...
    (microsoft.public.access.forms)
  • Re: referencing columns from list box?
    ... without the reference to Column) ... Doug Steele, Microsoft Access MVP ... Is there a way to get Me.MyTextbox to display ... The control source is Forest. ...
    (microsoft.public.access.formscoding)
  • Re: how to check whether Display variable is set or not
    ... you had warnings and strict enabled... ... exactly what value do you _want_ DISPLAY to have? ... code to accept whatever the correct string is. ... You may need to modify it to get it to work of course. ...
    (comp.lang.perl.misc)
  • Re: Modify Active Directory Schema Attribut Display Names
    ... Well first off, you can't change the lDAPDisplayName of pager or any other base schema attributes and for good reason, that is how applications identify the attributes. ... If you succeeded in changing the attribute, Active Directory Users and Computers wouldn't even know how to display it anymore. ... So if you want to try, what you actually need to do is to modify the display specifier for user objects. ...
    (microsoft.public.windows.server.active_directory)