J
Junior
in a click event-I'm trying to update all records (staNum field) in a table
based on min value of a field in a query [QSta]. but i get a pop up asking
me for parameter value strSta. what am i doing wrong
strSta = Nz(DMin("StaNum", "QSta"), "ZZ")
If strSta <> "ZZ" Then 'tbl is not empty
'update tables
MsgBox "strsta= " & strSta '<-----this value is correct
strSQL = "UPDATE tlkpService " & _
"SET [tlkpService].[StaNum] = strSta;"
DoCmd.RunSQL strSQL
based on min value of a field in a query [QSta]. but i get a pop up asking
me for parameter value strSta. what am i doing wrong
strSta = Nz(DMin("StaNum", "QSta"), "ZZ")
If strSta <> "ZZ" Then 'tbl is not empty
'update tables
MsgBox "strsta= " & strSta '<-----this value is correct
strSQL = "UPDATE tlkpService " & _
"SET [tlkpService].[StaNum] = strSta;"
DoCmd.RunSQL strSQL