2 similar fields

  • Thread starter Thread starter Aurora
  • Start date Start date
A

Aurora

I am using Access 2000
I want to create a form that indicates the employee who
begins a job and the employee who ends the job - using
their Emp ID#.

I created a table with 2 similar fields. 1) ID#IN as a
lookup field to another table (with emp names and ID#).
The ID#IN field picks up the ID#. 2) I then created a
second field ID#Out with the same lookup table. I
expected it to pick up the ID# - but it does not. It
tries to pick up the name instead. When I added the 2nd
field to the table I received a message that I already had
a ID#. Can't I pick up an ID# twice if the fields have a
different name?

Can anyone help me?
Aurora
 
That should be fine, but what do you mean by "lookup to another table"? Is
this a combo box based on a query used to select / display the name? Is it a
dLookup statement? Is the form based upon a query linking the 2 tables
together?

PS # is used as a date delimiter, so not the best choice for a field name
character.
 
Firstly, I hope you don't use "#" or any other "special" characters in Field
names (or names for Access objects, etc ...). Special characters in names
only create problems for you later!

* Rename the 2 Fields "EmpID_In" and "EmpID_Out" (just in case you think I
contradict myself, the underscore character "_" is not a special character).
* Make sure your Form's RecordSource includes the 2 renamed Fields.
* Make sure the 2 ComboBoxes are bound to the above 2 Fields.
* Make sure you set the BoundColumn of each ComboBox to the approriate
Column of the RowSource for the ComboBox. This is likely to be the problem
in your Form.

Access will pick up the name instead of the EmpID_??? if you specify the
"name" Column as the BoundColumn and you will get data type mismatch if
EmpID is of numeric type.

Now test your Form and see if it works correctly.

--
HTH
Van T. Dinh
MVP (Access)
 
Back
Top