Trying to populate data into form.......I'm an access beginner

D

dmorand

I've got a form which is created from a table. The table contains values
from other linked tables. which have primary keys which are stored in the
main table.

Here an example of the problem I'm having:

I have a field called "Application Request" that I want to display on the
form. It is a combo box which can contain various entries:

"Masterfile"
"Printed Form"
"Report".....etc etc etc

When I put the control source "Application Request" on the form, I'm getting
the key, not the actual value. 1 is in the combo box, not "Masterfile".

Do I need to modify the query for the form to include all of the values from
the linked tables that I want? I would have thought that if I was retrieving
the key values I could retrieve any of the data from the linked tables.

Is there something special I can put in the control source to pull the data
by having only the key?
 
G

Guest

If I understand correctly you want to see "Masterfile" instead of the 1. In
designview of the form go to the combobox and set the columnwidth to 0;2 the
bound column is probably the first column. By setting this to 0 you'll see
the actual value but in the table it will still record the 1 as beeing the
selected value.

If you want the actual value stored in the table you have to rearrange quite
a bit because of the normalization.

hth
 
J

John W. Vinson

I've got a form which is created from a table. The table contains values
from other linked tables. which have primary keys which are stored in the
main table.

Correction: the table contains NUMBERS, not text. If you've been misled by
Microsoft's "Lookup Wizard" misfeature, it may *look* like the table contains
"Masterfile" or the like - but it doesn't; it contains just a numeric ID. That
basic fact is concealed from your view by this abominable wizard. See
http://www.mvps.org/access/lookupfields.htm for a critique.
Here an example of the problem I'm having:

I have a field called "Application Request" that I want to display on the
form. It is a combo box which can contain various entries:

"Masterfile"
"Printed Form"
"Report".....etc etc etc

Again... the combo does not CONTAIN these entries. It *displays* these
entries. The values are stored in the table, and only in the table.
When I put the control source "Application Request" on the form, I'm getting
the key, not the actual value. 1 is in the combo box, not "Masterfile".

The combo box can store a 1 while it displays "Masterfile". To do this be sure
that the RowSource contains both the ID field and the text field, and set the
ColumnWidths property to have a zero width for the ID and a nonzero width for
the text. That way the computer sees the ID, you see the text, and you're both
happy.
Do I need to modify the query for the form to include all of the values from
the linked tables that I want? I would have thought that if I was retrieving
the key values I could retrieve any of the data from the linked tables.

Is there something special I can put in the control source to pull the data
by having only the key?

It's the properties of the Combo that you want to change - RowSource,
ColumnCount, and ColumnWidths - not the control source.

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