By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Lookup value in table

P: n/a
I have a 2 field table. Field 1 is Category (unique) and field 2 is
FilenameToOpen. In code I would like to search for a value in the field
Category. When the record is found I would like to pull out the value of
FileNameToOpen of that same record, in order to open the particular file.
How can I achieve this?
Thanks in advance,
john
Jun 8 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I'd use code like this dlookup("[filenametoopen]","table","[category] =
"&forms!formname!formfield] where you have your category listed on a form

"John" <jo@hn.comwrote in message
news:f4***********@textnews.wanadoo.nl...
>I have a 2 field table. Field 1 is Category (unique) and field 2 is
FilenameToOpen. In code I would like to search for a value in the field
Category. When the record is found I would like to pull out the value of
FileNameToOpen of that same record, in order to open the particular file.
How can I achieve this?
Thanks in advance,
john

Jun 8 '07 #2

P: n/a
Thanks Scott but I can't get it to work.

I have:
DLookup("[Bestandsnaam]", "tbSoortVerzoek", "[Soort_verzoek] = " &
Forms![frmVerzoek]!Soort_verzoek)
but I keep getting the error message:
Error 3075 during execution:
Syntax error (operator is missing) in query expression [Soort_verzoek] =
<<<form's value>>>
What am I doing wrong?

john

"Scott" <a@aschreef in bericht
news:46**********************@news.aliant.net...
I'd use code like this dlookup("[filenametoopen]","table","[category] =
"&forms!formname!formfield] where you have your category listed on a form

"John" <jo@hn.comwrote in message
news:f4***********@textnews.wanadoo.nl...
>>I have a 2 field table. Field 1 is Category (unique) and field 2 is
FilenameToOpen. In code I would like to search for a value in the field
Category. When the record is found I would like to pull out the value of
FileNameToOpen of that same record, in order to open the particular file.
How can I achieve this?
Thanks in advance,
john


Jun 9 '07 #3

P: n/a
Just found that

DLookup("[Bestandsnaam]", "tbSoortVerzoek", "[Soort_verzoek] = """ &
Forms![frmVerzoek]!Soort_verzoek & """")

somehow does work.
john

"John" <jo@hn.comschreef in bericht
news:f4**********@textnews.wanadoo.nl...
Thanks Scott but I can't get it to work.

I have:
DLookup("[Bestandsnaam]", "tbSoortVerzoek", "[Soort_verzoek] = " &
Forms![frmVerzoek]!Soort_verzoek)
but I keep getting the error message:
Error 3075 during execution:
Syntax error (operator is missing) in query expression [Soort_verzoek] =
<<<form's value>>>
What am I doing wrong?

john

"Scott" <a@aschreef in bericht
news:46**********************@news.aliant.net...
>I'd use code like this dlookup("[filenametoopen]","table","[category] =
"&forms!formname!formfield] where you have your category listed on a form

"John" <jo@hn.comwrote in message
news:f4***********@textnews.wanadoo.nl...
>>>I have a 2 field table. Field 1 is Category (unique) and field 2 is
FilenameToOpen. In code I would like to search for a value in the field
Category. When the record is found I would like to pull out the value of
FileNameToOpen of that same record, in order to open the particular file.
How can I achieve this?
Thanks in advance,
john



Jun 9 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.