Tried using DoCmd for the same task
DoCmd.RunSQL "update REASSIGNDAILY set STATUS = -1 where (((BATCHNO)= [rs4!batchno]));"
This time - no run time error, however prompting to enter a value for
rs4!batchno. Usage of '&' is giving an error. What modification is required on the SQL statement so that the value for rs4!batchno is passed automatically into the statement.
Encountering Run time error 3061 (too few parameters, expected 1) on
db.Execute ("UPDATE REASSIGNDAILY set STATUS = TRUE WHERE REASSIGNDAILY!BATCHNO = " & rs4!BATCHNO)
Am generating TABLE REASSIGNDAILY using a query. STATUS field is a new field added via the query with values TRUE OR FALSE. The field type however gets defined as 'Number'.
CODE Extract below:
Private Sub Reassign_Click()
Dim rs4 As Recordset
Set db = CurrentDb
Set Exobj = StartExtra("c:\Extra.edp")
Set rs4 = db.OpenRecordset("SELECT * from REASSIGNDAILY")
Yes it exists. know the syntax is ok but there is something else ...
As suggested, debugged code ----------
If (.GetString(11, 64, 80 - 64)) = "BATCH REASSIGNED" Then
DoCmd.RunSQL "update REASSIGNDAILY set STATUS = -1 where BATCHNO = " & rs4!batchno
'db.Execute ("update REASSIGNDAILY set STATUS = 0 where BATCHNO = " & rs4!batchno)
MsgBox (rs4!batchno) returned value BN221. Upon executing Do Cmd is prompting me to enter a value for BN221.
I have been trying quite a few combinations... will do a full recompile..