Forum Moderators: open
looping and updating could be as simple as this:
For i = 1 To 5
sqlString = "UPDATE yourTable SET tableRow = '" & someValue & "' WHERE anotherRow = " & i
' execute the sqlString
Loop It's a pretty useless query but it shows that looping isn't really that hard. Since we don't know what your form looks like or what it does, It's kinda hard to know if a For-loop will solve your problem.
Hmm, on the other hand, If the question was whether you can update multiple records in Access using just one (1) action, then the answer is both yes and no.
Yes, if the rows you want to update are all in the same table and should be updated with the same values. In that case you'd be able to use several WHERE clauses nestled together with an AND or/and an OR: ;)
sqlString = "UPDATE yourTable SET tableRow = '" & someValue & "' WHERE anotherRow = '" & anotherValue & "' OR anotherRow = '" & yetAnotherValue & "'" No, if you want to update different tables or update different rows in the same table. As far as I know, Access does not support executing multiple SQL queries in the same "action" ie:
sqlString = "UPDATE yourTable SET tableRow = 5; UPDATE yourTable SET otherRow = 6"
'Execute the query I probably haven't provided you with a complete solution here but, hopefully, it was a start. :)
A couple of good site where you can find ASP tutorials:
[4guysfromrolla.com...]
[asp101.com...]
[aspin.com...]
Good luck
//ZS