DLookUp

H

highland

Hello
I have such code in access in Form called Formularz1:

Private Sub Form_Current()
Forms!Formularz1.Caption = Me![name]
[Etykieta17].Caption=DLookUp("[name]";"Table3";"[id]=20")
End Sub

and when i want to launch Form named: Formularz1
i receive error: "Syntax error"
When i change line:
[Etykieta17].Caption=DLookUp("[name]";"Table3";"[id]=20")
to:
[Etykieta17].Caption= Me![name]

everything works fine. The problem is in DLookUP().
I have Table "Table3" and field "name" in it, which is connected
by field id with Table1 which is the source for Formularz1.
There is record with id=20, i want to display it on Etykieta17 Label.

Why DLookUp does not work ?

Thanx
Michal
 

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