Feild Links

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to link two fields so that when I enter the name in the name field the
next field automatically enters his title SVP. I have already created the
additional table with the names of the group and their title and I can
access all the names from a drop down box but how do I get the next field to
automatically add the title information in the next field?
 
You can use a DLookup in your combos AfterUpdate event:

Me.YourTitleTextBox = DLookup("strTitle", "tblTitles", "SomeField='" &
Me.YourCombo.Column(1) & "'"

Of course you'll have to change the table/field/control names to match your
own ... this assumes that you're looking up a Text field, hence the single
quote surrounding your Combo value ... if you need to lookup a Numeric
value, do away with the single quotes. Note also that columns in a combo are
zero based, therefore .Column(0) is the first column, .Column(1) is second,
etc etc
 
Back
Top