Solved: Help Needed with Dlookup (and greatly appreciated)
Hi,
This is my first time posting here and i am running into some problems using a Dlookup.
the code i am using is:
DLookup("[SumOfRSLT_1]", "qry_sumlaborhours", "[ACCTG_ACT] = ""charge1""")= x
charge1 is a variable defined as string
[ACCTG_ACT] is a text field
my problem is this: if i obtain a value for charge1 in the immediate window, and replace charge1 with that value in the dlookup, the dlookup will run perfectly. However, if i leave the variable in, it returns a null value.
I need to use a variable as i'm running through this dlookup many times to place values directly into excel.
Sorry if i didnt explain this well, i'm pretty new to VBA and my knowledge is limited