label caption

Firstly stop asking the same questions in two different threads please.:(

You said in this thread here that it was solved?

DLookup *returns* a value, most times by using some criteria.?
You cannot use a field element with spaces unless you surround the field in square brackets []

So if the contents of Me.cmbIndi can have spaces, enclose it in square brackets.

Try
Code:
Me.LblData.Caption = DLookup("[" & Me.cmbIndi & "]", Me.cmbPub, "[Tahun]=" & Me.cmbTahun)

HTH

I’m so sorry for duplicate question in difference threads :(
I think it was solved but after I try it again there was an error.

I try your code but there are new error
Run-time error ‘3464’ it said
 
Works for me?

Code:
tt3 = "description txt"
tt2 = "old transactions"
tt = "[" & tt3 & "]"
? dlookup(tt,tt2,"ID=12")
Mr N.L.Davies:139567
 
I’m so sorry for duplicate question in difference threads :(
I think it was solved but after I try it again there was an error.

I try your code but there are new error
Run-time error ‘3464’ it said
Hi. What does error 3464 say? If the square brackets didn't work, try adding double quotes too. For example:
Code:
DLookup("""[" & Me.cmbIndi & "]""", Me.cmbPub, "[Tahun]=" & Me.cmbTahun)
If it still doesn't work, you may have to consider removing the spaces from your field names.
 

Users who are viewing this thread

Back
Top Bottom