Search and update specific records

Nishikawa

Registered User.
Local time
Today, 15:20
Joined
May 17, 2007
Messages
97
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
 
Hello Nishikawa!

Look at "DemoSearchUpdateA2000.mdb",
I think it can help you.
Open Form1 and try.
Don't complicate.
 

Attachments

Thanks for your help!!!
 

Users who are viewing this thread

Back
Top Bottom