combo box problem

  • Thread starter Thread starter Donna
  • Start date Start date
D

Donna

I have a combo box based on a table which has two fields
(AppendixNumber and ProjectName). The "Bound" column is #1
or AppendixNumber. I want to display in a unbound field
on the form and subsequent report the [ProjectName] after
the user selects from the combo box.
I tried a "DLookup" function referring to the table, but
to no avail. Is this the wrong approach?
 
Donna (and others), I only dabble in this stuff so don't
take what I say below as an absolute.

On your form I'm assuming you use a combo box (made with a
wizard) to see your two fields. On your original table,
put the field you want to see in your combo box (after
making a selection) in the first column and not the second
column, as logic would suggest. On your form, go to
properties for your combo box and tell it that the bound
column is 2 (and not one). That should at least show you
both columns when you're making your selection but will
save the second column value in your table...sort of
(since this is an unbound field I guess it won't actually
save the value to a table unless you do some other
stuff). I may not have written this too well so if
something's not clear just come back with a request for
clarification and I'll see if I can't do better. Have a
good day. Scott
 
Addendum: Note that you'll have to delete and regenerate
your combo box on the form or it will 'remember' the
original table format.
 
Thanks for the suggestion, but here's where my skills go
sour. Column 1 (AppendixNumber) is the primary key used
in other table relationships. The 2nd column is text and
I didn't want to use text as a primary UNLESS that really
causes no problem(?). This text field can be as much as
40 characters long.
-----Original Message-----
Donna (and others), I only dabble in this stuff so don't
take what I say below as an absolute.

On your form I'm assuming you use a combo box (made with a
wizard) to see your two fields. On your original table,
put the field you want to see in your combo box (after
making a selection) in the first column and not the second
column, as logic would suggest. On your form, go to
properties for your combo box and tell it that the bound
column is 2 (and not one). That should at least show you
both columns when you're making your selection but will
save the second column value in your table...sort of
(since this is an unbound field I guess it won't actually
save the value to a table unless you do some other
stuff). I may not have written this too well so if
something's not clear just come back with a request for
clarification and I'll see if I can't do better. Have a
good day. Scott
-----Original Message-----
I have a combo box based on a table which has two fields
(AppendixNumber and ProjectName). The "Bound" column is #1
or AppendixNumber. I want to display in a unbound field
on the form and subsequent report the [ProjectName] after
the user selects from the combo box.
I tried a "DLookup" function referring to the table, but
to no avail. Is this the wrong approach?
.
.
 
Hello Donna
Not sure what the Unbound field (TextBox or ComboBox)
If it's a text box add this code to the Control Source and the text will
display

=([YourComboBoxName].[Column](1))

YourComboBoxName is the name of your ComboBox
 
Back
Top