Is it possible to execute a prepared statement in MS Access on a local table in VBA like this:
UPDATE part SET part_description=? WHERE part_id=?
If so how is it done?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That example used a new, unsaved
QueryDef. If you have a saved parameter query, you can use it instead by substituting this line for theCreateQueryDefline:Either way, you can then refer to individual parameters by their names as I did, or by their positions in the SQL statement … so this will work same as above:
Additional notes:
.Valueis the default property for aParameter, so including it here is not strictly required. On the other hand, it doesn’t hurt to be explicit.!which_id, which is more concise than.Parameters("which_id")