Multi-Column Combo-Box Tied by Primary Key

J

Jason Lopez

I am sure the subject made no sense. But here is what I am having trouble
dooing. I have two tables that I am trying to link together by way of the
userid of the individuals. That way the information stays specific to that
person and not their first name or any combo there of.

My problem comes in that I cannot get the table or the test form that I am
working on to display the name of the individual (query based on current
personnel) in the form's combo box and hold the userid as the value in the
table. No one should be able to see the userid on the form. The table is
the only place to see the userid. When you view the form, all I want
visible is the name of the person (as indicated from the query. My set-up
is like this:

Table1: Form1: qry1:
Table2:
userid userid userid
userid
fname tname tname: [fname] + " " + [lname]
lname

Table 2 is what I am using in the form with the userid being the common link
between everything.

Is there a direction that someone can point me in that might help? I have
stumbled upon how to do this once when I did not need to. But can't
duplicate it at this point.

Jason Lopez
 
A

Allen Browne

Try setting these properties for your combo:

Column Count: 2
Column Widths: 0
Bound Column: 1
RowSource: SELECT userid, fname & " " & lname AS FullName
FROM Table2
ORDER BY lname, fname, userid;
 
J

Jason Lopez

Those settings work awesome in the table. Now, is there a way that I can
use similar settings in the form because the column count and column widths
are not available as selections in the form's control box properties. I
have the method indicated below to fall back on. But is there a way that I
can do this same thing in the form without adding too much to the table
structure and design?

Jason

Allen Browne said:
Try setting these properties for your combo:

Column Count: 2
Column Widths: 0
Bound Column: 1
RowSource: SELECT userid, fname & " " & lname AS FullName
FROM Table2
ORDER BY lname, fname, userid;

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jason Lopez said:
I am sure the subject made no sense. But here is what I am having trouble
dooing. I have two tables that I am trying to link together by way of the
userid of the individuals. That way the information stays specific to
that person and not their first name or any combo there of.

My problem comes in that I cannot get the table or the test form that I
am working on to display the name of the individual (query based on
current personnel) in the form's combo box and hold the userid as the
value in the table. No one should be able to see the userid on the form.
The table is the only place to see the userid. When you view the form,
all I want visible is the name of the person (as indicated from the
query. My set-up is like this:

Table1: Form1: qry1: Table2:
userid userid userid userid
fname tname tname: [fname] + " " + [lname]
lname

Table 2 is what I am using in the form with the userid being the common
link between everything.

Is there a direction that someone can point me in that might help? I
have stumbled upon how to do this once when I did not need to. But can't
duplicate it at this point.

Jason Lopez
 
A

Allen Browne

On your form, you can use a combo for this field.
If you already have a text box for the field, in form design view,
right-click the text box, and choose:
Change To | Combo.

Then examine the properties of the combo (not the form).

FWIW, I normally use the combo on the form, and not in the table. When you
hide the real column in the table, newbies get confused about the kind of
data that is really stored there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Jason Lopez said:
Those settings work awesome in the table. Now, is there a way that I can
use similar settings in the form because the column count and column
widths are not available as selections in the form's control box
properties. I have the method indicated below to fall back on. But is
there a way that I can do this same thing in the form without adding too
much to the table structure and design?

Jason

Allen Browne said:
Try setting these properties for your combo:

Column Count: 2
Column Widths: 0
Bound Column: 1
RowSource: SELECT userid, fname & " " & lname AS FullName
FROM Table2
ORDER BY lname, fname, userid;

Jason Lopez said:
I am sure the subject made no sense. But here is what I am having
trouble dooing. I have two tables that I am trying to link together by
way of the userid of the individuals. That way the information stays
specific to that person and not their first name or any combo there of.

My problem comes in that I cannot get the table or the test form that I
am working on to display the name of the individual (query based on
current personnel) in the form's combo box and hold the userid as the
value in the table. No one should be able to see the userid on the
form. The table is the only place to see the userid. When you view the
form, all I want visible is the name of the person (as indicated from
the query. My set-up is like this:

Table1: Form1: qry1: Table2:
userid userid userid userid
fname tname tname: [fname] + " " + [lname]
lname

Table 2 is what I am using in the form with the userid being the common
link between everything.

Is there a direction that someone can point me in that might help? I
have stumbled upon how to do this once when I did not need to. But
can't duplicate it at this point.
 

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