M
Mauro
I am using VBA to update an existing recordset. I can not get the find to
work for me. I need to find the specific ID and then edit the record
containing that ID. The Findnext gives me an error msg 'object required'.
' ***** Start Code ******
Private Sub cmd_SAVE_RECORD_Click()
On Error GoTo Err_cmd_SAVE_RECORD_Click
Dim dbQATApp As DAO.Database
Dim rstupdateMon As DAO.Recordset
Dim rstFORM As DAO.Recordset
Dim blncriteria As Boolean
Set dbQATApp = CurrentDb
Set rstupdateMon = dbQATApp.openrecordset("MAIN_QAT_MONITOR_INFO_TABLE")
Set rstFORM = Me.txt_MONITOR_STATUS.Value
blncriteria = IsNull(DLookup("[QAT_MONT_QID]",
"[MAIN_QAT_MONITOR_INFO_TABLE]", "[QAT_MONT_INFO_ID]=" &
Me.lst_MONITOR_LIST.Value))
If blncriteria = False Then
MsgBox "no match"
Else
'*** Find record - not working*****
rstupdateMon.FindNext (QAT_MONT_INFO_ID = txt_MONITOR_STATUS.Value)
MsgBox "Found Value"
'**** write data *****
rstupdateMon.Edit
rstupdateMon("QAT_MONT_QID").Value = Me.txt_QTEAM_ID.Value
rstupdateMon("QAT_MONT_CREATE_DATE").Value = Now()
rstupdateMon("QAT_MONT_QAC").Value = Me.txt_CURRENT_USER
rstupdateMon("QAT_MONT_REP_ID").Value = Me.txt_REPRESENTATIVE_VALUE
rstupdateMon("QAT_MONT_SUP_ID").Value = Me.txt_REPRESENTATIVE_FILTER
rstupdateMon("QAT_MONT_TYPE").Value = Me.lst_MONITOR_TYPE
rstupdateMon("QAT_MONT_SCORE").Value = Me.txt_OVERALL_SCORE
rstupdateMon("QAT_MONT_FCR").Value = Me.rdo_FCR
rstupdateMon("QAT_MONT_MEMO").Value = Me.mem_MEMO
rstupdateMon.Update
rstupdateMon.Close
End If
' ***** End Code ******
work for me. I need to find the specific ID and then edit the record
containing that ID. The Findnext gives me an error msg 'object required'.
' ***** Start Code ******
Private Sub cmd_SAVE_RECORD_Click()
On Error GoTo Err_cmd_SAVE_RECORD_Click
Dim dbQATApp As DAO.Database
Dim rstupdateMon As DAO.Recordset
Dim rstFORM As DAO.Recordset
Dim blncriteria As Boolean
Set dbQATApp = CurrentDb
Set rstupdateMon = dbQATApp.openrecordset("MAIN_QAT_MONITOR_INFO_TABLE")
Set rstFORM = Me.txt_MONITOR_STATUS.Value
blncriteria = IsNull(DLookup("[QAT_MONT_QID]",
"[MAIN_QAT_MONITOR_INFO_TABLE]", "[QAT_MONT_INFO_ID]=" &
Me.lst_MONITOR_LIST.Value))
If blncriteria = False Then
MsgBox "no match"
Else
'*** Find record - not working*****
rstupdateMon.FindNext (QAT_MONT_INFO_ID = txt_MONITOR_STATUS.Value)
MsgBox "Found Value"
'**** write data *****
rstupdateMon.Edit
rstupdateMon("QAT_MONT_QID").Value = Me.txt_QTEAM_ID.Value
rstupdateMon("QAT_MONT_CREATE_DATE").Value = Now()
rstupdateMon("QAT_MONT_QAC").Value = Me.txt_CURRENT_USER
rstupdateMon("QAT_MONT_REP_ID").Value = Me.txt_REPRESENTATIVE_VALUE
rstupdateMon("QAT_MONT_SUP_ID").Value = Me.txt_REPRESENTATIVE_FILTER
rstupdateMon("QAT_MONT_TYPE").Value = Me.lst_MONITOR_TYPE
rstupdateMon("QAT_MONT_SCORE").Value = Me.txt_OVERALL_SCORE
rstupdateMon("QAT_MONT_FCR").Value = Me.rdo_FCR
rstupdateMon("QAT_MONT_MEMO").Value = Me.mem_MEMO
rstupdateMon.Update
rstupdateMon.Close
End If
' ***** End Code ******