Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Primary Key Problem

Status
Not open for further replies.

ITProg

Programmer
Nov 9, 2004
43
US
I am having trouble with data entry to a form. I have a table tblReview, with primary key staffno. I have a table tblStaff, with primary key staffno. On the data entry form I have a combo box to select the staff no. When I select the staff no from the combo box it will then fill in a text box for last name and a text box for first name. This used to work when the primary key for tblReview was ReviewID which was an autonumber. If I change the primary key back to ReviewID, the boxes will fill in properly. If I change the primary key to staffno, it won't fill in any data for the last name and first name. I need the primary key to be StaffNo. An autonumber field as primary key does not suit my purpose anymore.
 
Any chance you could post the relevant code that fills the boxes and the relevant properties of the combo like RowSource and BoundColumn ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Below is the code for rowsource for the combo box on the data entry form:

SELECT [tblStaff].[staffno], [tblStaff].[LName], [tblStaff].[FName] FROM tblStaff;

BoundColumn=1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top