Simple question I think

  • Thread starter Thread starter Michael Walsh
  • Start date Start date
M

Michael Walsh

Fist things first I didn't create this situation and I'm
not even responsible to fix it, but the following
information would temporarilt fix this problem and would
help for suture considerations.

There is a form that populates a table. One of the fields
is a lookup. Here's the bad database design part. That
lookup should populate two different fields in the table,
1 - name and 2 - NameID. Anyway the database is little
too complicated and poorly designed to fix correctly, but
going forward I can solve the problem by making sure both
fields are captured instead of just the one.

The Name drop-down definitely contains the NameID, but it
only captures Name. I would like to add NameID as a field
and I would like to have it populated based on the
selection in the Name field.

Any help is greatly appreciated.
 
There is a form that populates a table. One of the fields
is a lookup. Here's the bad database design part. That
lookup should populate two different fields in the table,
1 - name and 2 - NameID. Anyway the database is little
too complicated and poorly designed to fix correctly, but
going forward I can solve the problem by making sure both
fields are captured instead of just the one.

You can "push" a second field from the combo into a (redundant,
unnecessary, and problematic - but you know that) bound control in the
Combo's AfterUpdate event. Invoke the Code Builder and put in code
like:

Private Sub cboName_AfterUpdate()
Me!txtNameID = cboName.Column(0)
End Sub

using, of course, your own field and control names. The Column()
property is zero based so (0) would be the first column, (1) the
second and so on.
 
Back
Top