Form for table

S

schongresh

Here's the problem:

Access 2003, XP Pro-

I have three tables that are related by primary keys. I have a
table[Table QC] that has the field [EmployeeID], the data type is
number--that field is linked to the autonumber primary key of the
Employees Table. So far so good. I am trying to make a form that has a
combo box that looks to the Employee Table to get me the drop down of
the employees (Last Name, First Name). The SQL statement builds out
okay, and I get the correct name config., but because the data type is
a number it won't accept the data. I looked at the Northwind example
and it is identical to what I am trying to do. I have the properties
set identically. In the Northwind example the names show in the field
Last Name, First Name, but the data type is set for number. I must be
missing something simple. Please help.

Thanks,

Sean
 
R

Rick Brandt

schongresh said:
Here's the problem:

Access 2003, XP Pro-

I have three tables that are related by primary keys. I have a
table[Table QC] that has the field [EmployeeID], the data type is
number--that field is linked to the autonumber primary key of the
Employees Table. So far so good. I am trying to make a form that has a
combo box that looks to the Employee Table to get me the drop down of
the employees (Last Name, First Name). The SQL statement builds out
okay, and I get the correct name config., but because the data type is
a number it won't accept the data. I looked at the Northwind example
and it is identical to what I am trying to do. I have the properties
set identically. In the Northwind example the names show in the field
Last Name, First Name, but the data type is set for number. I must be
missing something simple. Please help.

Thanks,

Sean

The ComboBox needs to have a hidden column containing the numeric ID value and
you make that the bound column. The control displays text but has a numeric
value. If you look again at Northwind you will see that this is how they have
it set up.
 
S

schongresh

schongresh said:
Here's the problem:
Access 2003, XP Pro-
I have three tables that are related by primary keys. I have a
table[Table QC] that has the field [EmployeeID], the data type is
number--that field is linked to the autonumber primary key of the
Employees Table. So far so good. I am trying to make a form that has a
combo box that looks to the Employee Table to get me the drop down of
the employees (Last Name, First Name). The SQL statement builds out
okay, and I get the correct name config., but because the data type is
a number it won't accept the data. I looked at the Northwind example
and it is identical to what I am trying to do. I have the properties
set identically. In the Northwind example the names show in the field
Last Name, First Name, but the data type is set for number. I must be
missing something simple. Please help.

Sean

The ComboBox needs to have a hidden column containing the numeric ID value and
you make that the bound column. The control displays text but has a numeric
value. If you look again at Northwind you will see that this is how they have
it set up.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com- Hide quoted text -

- Show quoted text -

Thanks. The wizard automatically hides the primary key(number). So,
under properties there should be two columns, with the one with the
expression [LastName]&", "&[FirstName] showing visible and the ID
number not-visible?
 
J

John W. Vinson

Thanks. The wizard automatically hides the primary key(number). So,
under properties there should be two columns, with the one with the
expression [LastName]&", "&[FirstName] showing visible and the ID
number not-visible?

Yes. The visibility is not handled with a "Visible" property though, but
rather with the ColumnWidths property. Set the width of the ID field to 0 and
that of the concatenated name to something big enough to see the name for most
records.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top