vba - No value given for one or more required parameters visual basic error -


this error appearing in following line of vb code

 rs.open "select * reservation [table_number]=tablenumber.text , booking_date=bookingdate.text", cn, adopenstatic, adlockpessimistic 

it's problem sql query. reason message sql parser can't identify token in sql query , interprets parameter need provide value.

so, either mistyped of field or table names, or created sql wrong way. suppose latter , should read

 rs.open "select * reservation [table_number] = " & tablenumber.text & " , booking_date=" & bookingdate.text, cn, adopenstatic, adlockpessimistic 

because tablenumber , bookingdate form controls.

the above query won't work out of box need use correct data types sql query cannot infer based on sparse information.


Comments