Primary Keys

  • Thread starter Thread starter jdickerson
  • Start date Start date
J

jdickerson

All,

Here is my dilemma. I have a table listing item#'s and item descriptions.
The item# is the primary key. I have a form that captures item# description
and other information. I would like the description field to auto fill once
the item# is entered. I can not use a combo box as there will be nearly 1000
items. Any help or suggestions would be appreciated.

Jamie
 
Create a query using both your Items table, and also this table where items
are used. Select * from this table, and the [Description] field from the
Items table.

Use that query as the source for your form. Place the Description text box
on the form, and set its Locked property to Yes so the user cannot change
it. Now when you enter a valid item number, the description will show
automatically.

(You could use a combo with 1000 items if you wanted to.)
 
I have a database with a multi column combo box with over 100,000 items.
The users don't search for items in the list - they just type the number in.
When they hit enter the after update event looks at the other combo columns
and drops the info into the appropriate fields on the form. My example has
4 columns in the combo (0 - 3), though the users only see two (the others
have width of 0)

Private Sub DocNumberSelect_AfterUpdate()
OfficeLocation = DocNumberSelect.Column(1)
CreateDate = DocNumberSelect.Column(2)
LastEditBy = DocNumberSelect.Column(3)
End Sub

Also using a combo can allow you to restrict users to only items listed
there so thay can't enter incorrect information.
Mich
 
Back
Top