Hi all,
I'm trying to set a text box value from a table based on a combobox selection but keep getting a missing table error.
Me.ExpiryClose is the textbox
Me.WrittenOptions is combo
expirytable is a string variable
TGDec16 is my table
When I debug print expirytable it prints TGDec16
If i replace the variable, it works.
I'm no doubt missing some syntax but can't see what.
Any help appreciated.
El-d.
I'm trying to set a text box value from a table based on a combobox selection but keep getting a missing table error.
Me.ExpiryClose is the textbox
Me.WrittenOptions is combo
expirytable is a string variable
TGDec16 is my table
When I debug print expirytable it prints TGDec16
Code:
Me.ExpiryClose = DLookup("[Expiry]", " & expirytable & ", "[Company]= '" & Me.WrittenOptions & "'")
If i replace the variable, it works.
Code:
Me.ExpiryClose = DLookup("[Expiry]", "TGDec16", "[Company]= '" & Me.WrittenOptions & "'")
I'm no doubt missing some syntax but can't see what.
Any help appreciated.
El-d.