G
Guest
Hi
I have a subform which is to make an invoice to add products (granite slabs)
to.
Default data is to be drawn from an existing stocktake file, but should be
able to be changed.
The ID field is a combo box, this is what i have at the moment
Private Sub ID_AfterUpdate()
[Forms]![Invoices].Recalc
CustomLength = DLookup("Length", "Stocktake", "[ID]=" & ID)
CustomWidth = DLookup("Width", "Stocktake", "[ID]=" & ID)
Colour = DLookup("Colour", "Stocktake", "[ID]=" & ID)
Pricesqm = DLookup("Price", "Prices", "[Colour]= " & Colour)
Sold = True
End Sub
The length and width come up, and that works perfectly, but it won't give me
the price. It keeps coming up with an error for "[Colour]= " & Colour
criteria as follows
Run time error '3075':
Syntax error (missing operator) in query expression '[Colour] = Impala Black
(Tiger Black)'.
Whats wrong?
Any help would really be appreciated.
Thanks
Kody.
I have a subform which is to make an invoice to add products (granite slabs)
to.
Default data is to be drawn from an existing stocktake file, but should be
able to be changed.
The ID field is a combo box, this is what i have at the moment
Private Sub ID_AfterUpdate()
[Forms]![Invoices].Recalc
CustomLength = DLookup("Length", "Stocktake", "[ID]=" & ID)
CustomWidth = DLookup("Width", "Stocktake", "[ID]=" & ID)
Colour = DLookup("Colour", "Stocktake", "[ID]=" & ID)
Pricesqm = DLookup("Price", "Prices", "[Colour]= " & Colour)
Sold = True
End Sub
The length and width come up, and that works perfectly, but it won't give me
the price. It keeps coming up with an error for "[Colour]= " & Colour
criteria as follows
Run time error '3075':
Syntax error (missing operator) in query expression '[Colour] = Impala Black
(Tiger Black)'.
Whats wrong?
Any help would really be appreciated.
Thanks
Kody.