M
Mishanya
I've asked this before, but still can't get any further.
I'm trying to populate txtBox ClentName in the form, which is based on the
table that have ClientID as foreign key (so it only can pull the Autonumber
and I don't want to use Combobox to present ClientName because it is
read-only form).
So I put this in the ControlSource:
=DLookup("ClientName", "tblClients", "ClientID = " & ClientID)
well, I can not leave the ControlSource, cuz this msg pops up:
"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid character or
comma, or you entered text without surrounding it in quotation marks"
I put [] on ClientID:
=DLookup("ClientName", "tblClients", "ClientID = " & [ClientID])
same effect (none - same error msg).
I checked myself putting exactly the same syntax in On Load event of the form:
ClientName = DLookup("ClientName", "tblClients", "ClientID = " & ClientID) -
and it works! So the syntax is OK.
Moreover - I copied the DB to other laptop and tried to enter same Dlookup
to my txtBox - it worked too! With no error msg.
I even reinstalled MS Office using the one wich is installed in the laptop
where my Dlookup worked - but again, nothing changed - same message, as if it
is my computer that does not want to digest it.
So, the syntax is OK (worked in On Load and in other computer), the Office
is OK - what is not OK?
I'm trying to populate txtBox ClentName in the form, which is based on the
table that have ClientID as foreign key (so it only can pull the Autonumber
and I don't want to use Combobox to present ClientName because it is
read-only form).
So I put this in the ControlSource:
=DLookup("ClientName", "tblClients", "ClientID = " & ClientID)
well, I can not leave the ControlSource, cuz this msg pops up:
"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid character or
comma, or you entered text without surrounding it in quotation marks"
I put [] on ClientID:
=DLookup("ClientName", "tblClients", "ClientID = " & [ClientID])
same effect (none - same error msg).
I checked myself putting exactly the same syntax in On Load event of the form:
ClientName = DLookup("ClientName", "tblClients", "ClientID = " & ClientID) -
and it works! So the syntax is OK.
Moreover - I copied the DB to other laptop and tried to enter same Dlookup
to my txtBox - it worked too! With no error msg.
I even reinstalled MS Office using the one wich is installed in the laptop
where my Dlookup worked - but again, nothing changed - same message, as if it
is my computer that does not want to digest it.
So, the syntax is OK (worked in On Load and in other computer), the Office
is OK - what is not OK?