dlookup problem

M

mike bfd

i am just learning to use access and have a problem. i am trying add data
from a table to a active form.
the table is named departments
it has three columns id,department code, department discription
i have a combo603 on the active form that i am uses in the critia.
=DLookUp(" [Department discription]","[departments]","
[Departments]![Dpartment code]=" & [Combo603])

[combo603] presentas a number form the table [departments]![department code]
 
F

fredg

i am just learning to use access and have a problem. i am trying add data
from a table to a active form.
the table is named departments
it has three columns id,department code, department discription
i have a combo603 on the active form that i am uses in the critia.
=DLookUp(" [Department discription]","[departments]","
[Departments]![Dpartment code]=" & [Combo603])

[combo603] presentas a number form the table [departments]![department code]

The bound column of the Combo box is a Number datatype?
Did you check for spelling errors in your syntax?
Discription is not the same as description.
Dpartment is not the same as Department.

I have no idea of what the actual field names are.
The spelling is not important as long as it matches exactly the actual
field name.

=DLookUp("[Department description]","[departments]","
[Department code]=" & [Combo603])

Should work if the field names are spelled normally, and the datatype
of [Department code] is Number, not text.
 
J

John W. Vinson

On Thu, 31 Jan 2008 16:07:01 -0800, mike bfd <mike
i am just learning to use access and have a problem. i am trying add data
from a table to a active form.

You've got it backwards.

You add data *to tables* USING forms. Forms are just windows; they do not
contain or store data.
the table is named departments
it has three columns id,department code, department discription
i have a combo603 on the active form that i am uses in the critia.
=DLookUp(" [Department discription]","[departments]","
[Departments]![Dpartment code]=" & [Combo603])

[combo603] presentas a number form the table [departments]![department code]

Ok. What's happening that you don't want to happen, or not happening that you
do want to happen? You haven't stated a problem. What's the Recordsource for
the form?

If you just want to see the department description, you don't need a DLookUp
at all; put a Textbox on the form with Control Source

=[Combo603].Column(2)

to display the third (it's zero based) column of the combo box.

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