I cant figure this out. im trying to use a variable as my field name lookup in a dlookup statment.
if i change the variable to this it works fine
can anyone help with this, i think ive been through every combo of quotations and brackets that i can think of, but everytime i get the error.
missing operator in query expression '1x1'.
if i change the variable to this it works fine
Code:
price = "[1 x 1]"
Code:
Dim pipesize As String
Dim price As String
If Me.PipeSizeTxt.Value = 0.5 Then
pipesize = "1/2"
ElseIf Me.PipeSizeTxt.Value = 0.75 Then
pipesize = "3/4"
ElseIf Me.PipeSizeTxt.Value = 1.25 Then
pipesize = "1 1/4"
ElseIf Me.PipeSizeTxt.Value = 1.5 Then
pipesize = "1 1/2"
ElseIf Me.PipeSizeTxt.Value = 2.5 Then
pipesize = "2 1/2"
ElseIf Me.PipeSizeTxt.Value = 3.5 Then
pipesize = "3 1/2"
ElseIf Me.PipeSizeTxt.Value = 4.5 Then
pipesize = "4 1/2"
Else
pipesize = Me.PipeSizeTxt.Value
End If
price = Me.InsulationSizeTxt.Value & "x" & pipesize
' just to check that the variable is producing
MsgBox price
'is producing the variable and not the lookup
'Me.TotalPriceTxt.Caption = Nz(DLookup(" '" & [price] & "'", "[Pricing]"))
Me.TotalPriceTxt.Caption = Nz(DLookup([price], "[Pricing]"))
can anyone help with this, i think ive been through every combo of quotations and brackets that i can think of, but everytime i get the error.
missing operator in query expression '1x1'.