Hi,
How do I ask MS access to search a particular record in a table and update a certain field after user have click on a "checked" button in a form?
I tried the following code but failed. Please help.
Thanks in advance!!
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim DSCSearch As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("StowageLayoutLog", dbOpenDynaset)
If Forms!Display.[Subform-Display].Form![INIT] <> "" Then
If Forms!Display![Subform-Display].Form![Stowage instruction sent] = "-1" Then
DSCSearch = DLookup("[DSC]", "StowageLayoutLog", "[DSC] = Forms!Display![Subform-Display].Form![DSC]")
With rst
If rst.NoMatch Then
Else
.Edit
![SI Sent] = Now()
.Update
'End If
End With
End If
End If
How do I ask MS access to search a particular record in a table and update a certain field after user have click on a "checked" button in a form?
I tried the following code but failed. Please help.
Thanks in advance!!
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim DSCSearch As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("StowageLayoutLog", dbOpenDynaset)
If Forms!Display.[Subform-Display].Form![INIT] <> "" Then
If Forms!Display![Subform-Display].Form![Stowage instruction sent] = "-1" Then
DSCSearch = DLookup("[DSC]", "StowageLayoutLog", "[DSC] = Forms!Display![Subform-Display].Form![DSC]")
With rst
If rst.NoMatch Then
Else
.Edit
![SI Sent] = Now()
.Update
'End If
End With
End If
End If