Connecting Tech Pros Worldwide Forums | Help | Site Map

Primary key relationship question.

Member
 
Join Date: Nov 2006
Posts: 72
#1: Apr 2 '07
Good Morning everyone,

Access2003, I have a table tblTechTaskCards. In this table there are 3 fields: WIC ID field is a autonumber field that is also the primary key. I had to do this because the other two fields "Card Name" and "Card Number" are not unique.

Now this table has a "one to many relationship" with table tblAcftJobsComp. In this form, field "Work Card" is a look up combo box the row source type is a table/query and the row source is
Expand|Select|Wrap|Line Numbers
  1. SELECT tblTechTaskCards.[WIC ID], tblTechTaskCards.[Card Number], 
  2. tblTechTaskCards.[Card Name] 
  3. FROM tblTechTaskCards 
  4. ORDER BY tblTechTaskCards.[Card Number];
Bound Colum is 1
Column Count 3

Unfortunatly my users would like for the "Card Number" display first in the dropdown list, so they can easily type in the first number in the card number and the list will go to that section. However, when I swap the columns Access doesnt like it since the WIC ID is a number field and "Card Number" contains both numbers and letters. Since for the relationship to work both fields must be same type, right?

Is there anyway to get around this problem?

Have I explained myself? Do you need more info?

Hope you can help.

Regards,

Member
 
Join Date: Nov 2006
Posts: 72
#2: Apr 2 '07

re: Primary key relationship question.


Solved it.

Swapped columns, switched bound column to 3, no more errors. For now hehehe.
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,885
#3: Apr 2 '07

re: Primary key relationship question.


Quote:

Originally Posted by Rotor

Solved it.

Swapped columns, switched bound column to 3, no more errors. For now hehehe.

Glad you got it working.

Mary
Member
 
Join Date: Nov 2006
Posts: 72
#4: Apr 2 '07

re: Primary key relationship question.


Quote:

Originally Posted by mmccarthy

Glad you got it working.

Mary

Thank you. You know the blind squirrel gets a nut once in a while. :)
Reply