how about a faster, easier, less-typing approach?
dim strSQL as string
strSQL = "UPDATE tblRMR19_3 SET revisionField = revisionField + 1 WHERE RMR_NBR ='" & Me.cmbRMR & "';"
i don't understand your plans for revisiondt - if this is also supposed to find it's way into the table, maybe you need:
strSQL = "UPDATE tblRMR19_3 SET revisionField = revisionField + 1, dateField = #" & format$(now, "mm/dd/yyyy hh:nn:ss") & "# WHERE RMR_NBR ='" & Me.cmbRMR & "';"
your code is fairly strange in any case
Me!revision = 1
rs("revision") = Me!revision
if the recordset is empty (the meaning of your Else) you can't set the value of a field in a (non-existant) record. in any case, after taking all the effort to increment revision in some records it seems bizarre to want to reset it to 1 again in other records.
your SELECT does not include a field (or alias) 'revision' so
Me!revision = (revision) + 1
is doomed (and in any case, your (revision) should have been Me!revision)
finally, your SELECT uses single quotes in
RMR_NBR ='" & Me.cmbRMR & "'"
suggesting that RMR_NBR is text. _NBR smells like a NumBeR to me, so you might need to drop those single quotes.
using the real names for revisionField and dateField of course
Last edited by izyrider; 10-29-06 at 02:53.
currently using SS 2008R2