Hi barryhuizenga,
From what I understand this is what happens:
- You click a button to insert the time called into a patient's record
- This button specifies which patient you wish to modify
- What you want to do is simply update the time called (PAT_TimeSeen) field of that table
If this is correct then these hints might help.
If the button already 'knows' the patient's record ID, I assume you have an ID and that it is called PAT_ID, then I would do the following:
Dim recTimeCalled As Recordset
'NOTE you can use CurrentDB without setting a variable
Set recTimeCalled = CurrentDB.OpenRecordset("SELECT * FROM tblPatient WHERE PAT_ID = " & <Patient's ID>)
'This will select the ONE record specifying the current patient
recTimeCalled.Edit
recTimeCalled!PAT_TimeSeen = Now()
'NOTE recTimeCalled!PAT_TimeSeen is equivalent to recTimeCalled.("PAT_TimeSeen")
recTimeCalled.Update
This should set the time for that patient.
However, if the button does not 'know' which patient you want to update you will have to specify that somehow.
Also, if you don't have and ID then you will have to find and use the primary key in the WHERE clause.
Hope this helps
Yomet