Theguyinthehat
Registered User.
- Local time
- Today, 09:32
- Joined
- Aug 17, 2009
- Messages
- 46
Designing a database able to hold a lot of simultaneous lots that needs at least two edits after creation--Time Worked and Time Completed. However, I am having trouble. I need to:
1) Lift the Lot Number off of the combo box
2) Search for the Lot Number in the Job Entry Table (it could be anywhere)
3) Edit the Time Worked field for the corresponding Lot Number.
My code so far:
Private Sub Save_Click()
Me![TimeWorking].Value = Now()
Dim db As Object
Dim that As Object
Set db = CurrentDb
Set that = db.OpenRecordset("JobEntry")
DoCmd.FindRecord Me![LotNumber]
that.Edit
that("Time Working").Value = Me![TimeWorking].Value
that.Update
End Sub
**TimeWorking is a text box
"Time Working" is the field value
LotNumber is the Combobox and the primary key in the table
This code doesn't work--it thinks I'm trying to make a new entry. Please help!
1) Lift the Lot Number off of the combo box
2) Search for the Lot Number in the Job Entry Table (it could be anywhere)
3) Edit the Time Worked field for the corresponding Lot Number.
My code so far:
Private Sub Save_Click()
Me![TimeWorking].Value = Now()
Dim db As Object
Dim that As Object
Set db = CurrentDb
Set that = db.OpenRecordset("JobEntry")
DoCmd.FindRecord Me![LotNumber]
that.Edit
that("Time Working").Value = Me![TimeWorking].Value
that.Update
End Sub
**TimeWorking is a text box
"Time Working" is the field value
LotNumber is the Combobox and the primary key in the table
This code doesn't work--it thinks I'm trying to make a new entry. Please help!
Last edited: