
Newbie seeks help with Select Statement
What are the types in your [cboItem1]
If it's dates then use: WHERE [OrderItemID] = #" & Me![cboItem1] & "#;"
'Note must be valid SQL date
If it's strings then use: WHERE [OrderItemID] = '" & Me![cboItem1] & "';"
If it's numbers then use: WHERE [OrderItemID] = " & Me![cboItem1] & ";"
If it's a Null you will have to solve that issue as well.
--
Regards Hans-Chr. Francke
www.master-office.com
Quote:
> Am trying to edit records with DAO, and keep getting a type mismatch error
> when using the following code:
> Set rs = db.OpenRecordset("SELECT * FROM tblOrderItems WHERE [OrderItemID]
=
> '" & Me![cboItem1] & "'", dbOpenDynaset)
> When I try this alternative, I get an error indicating Too few paramters.
> Expected 1:
> Set rs = db.OpenRecordset("SELECT * FROM tblOrderItems WHERE [OrderItemID]
=
> Me![cboItem1]", dbOpenDynaset)
> I am sure this will only take a second, so thank you in advance.
> Regards,
> Alex