Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I pass multiple values for a single parameter?

Status
Not open for further replies.

childrenfirst

Technical User
Oct 15, 2006
80
0
0
US
Hi,

I am not sure if it can be done. I have a form which shows several records. Users get to check the checkbox associated to each record if they want to delete the record. After users click on a command button on the form, the on click event is supposed to pass the ID number of any (can be none, one, or many) records to be deleted to a SQL stored procedure and the records will be deleted from SQL table.

The problem occurrs when users check multiple records to delete, how do I pass multiple values from vba Access to a single parameter in SQL stored procedure (this is just an idea and I am not sure exactly how to do it in vba... Is there something like dynamic SQL in vba?)? Do I need to turn all the values into a single string in vba and then break them apart in the stored procedure?

Thank you, thank you, thank you!

CF
"Are things getting tougher, or it's just my brain that does not seem to work well toward the end of the year?
 
you should create a delete query with the query builder where the field of the checkBox = "-1" in the criteria

hope you got it just go to queries and create a new one and choose a delete query from the query type list on the toolbar

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Hello,

Couldn't you call your stored procedure for EACH element selected?

If there's 4 elements selected you could run a loop and 'call' your storedproc 4 times.

Hope it is of some help.

SG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top