Hi,
I want to ask how can I lock certain fields if the record of a patient already exist?
I have a field named Patient_ID on my field and have a code on it.
Here's the Code :
Code:
----------------------------------------------------------------------
Dim PID As String
Dim stLinkCriteria As String
Dim rsc As DAO.RecordsetSet
rsc = Me.RecordsetClone
PID = Me.Patient_ID.Value
stLinkCriteria = "[Patient_ID]=" & "'" & PID & "'"
'Check PatientDetails table for duplicate PatientNumber
If DCount("Patient_ID", "Patient_info_TBL", stLinkCriteria) > 0 then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning Patient Number " _
& PID & " has already been entered." _
& vbCr & vbCr & "You will now be taken to the record.", vbInformation_
, "Duplicate Information"
'Go to record of original Patient Number
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
----------------------------------------------------------------------
How can I lock the patient's last name & first name fields if the record already exist?
I want to prevent changing the patient's last name & first name field if they exist and how can I reset the last name & first name fields it's new record?
Pls help. Thanks...
Jim