R
Richard B
Guest
I am trying to get a command button on a form to update one of the fields on the same form when it is clicked. All I want it to do is change the value in the field to a the word "submitted" each time it is clicked. I only want it to change the value in the current record.
I have tried the following code:
Dim db As Database
Set db = CurrentDb()
' Updating "Request Status" Field to submitted
Dim rec As Recordset
Set rec = db.OpenRecordset("tblBase")
DoCmd.Requery
' Copy the current record to the copy buffer
rec.Edit
' Make changes to current record
rec("Request Status") = "Submitted"
' Save contents of copy buffer
rec.Update
But it doesn't do what I hoped.
Any help would be much appreciated.
I have tried the following code:
Dim db As Database
Set db = CurrentDb()
' Updating "Request Status" Field to submitted
Dim rec As Recordset
Set rec = db.OpenRecordset("tblBase")
DoCmd.Requery
' Copy the current record to the copy buffer
rec.Edit
' Make changes to current record
rec("Request Status") = "Submitted"
' Save contents of copy buffer
rec.Update
But it doesn't do what I hoped.
Any help would be much appreciated.