Hi, Thanks in advance for any help anyone can give.
I've got a db that I'd like a group of users to have read-only access to, which I've set through UserLevel Security. Problem is, it is a database of patient records that has a search box whereby you enter in the ID of the patient, click search and the record comes up. The code for the search button is:
As the admin, I can use that button with no problem, it's when I test it as a read-only user, the error "The Command or Action SaveRecord isn't available now". Obviously, since the button calls to save the current record and then search for the new patient, you can't save the record as a read-only user.
Does anyone know what I could replace SaveRecord with? Is there just a command to quit the current record?
Thanks
I've got a db that I'd like a group of users to have read-only access to, which I've set through UserLevel Security. Problem is, it is a database of patient records that has a search box whereby you enter in the ID of the patient, click search and the record comes up. The code for the search button is:
Private Sub Command286_Click()
On Error GoTo Err_Command286_Click
Dim response As Integer
Dim LastRecordFound As Long
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
LastRecordFound = Me.CurrentRecord
DoCmd.GoToControl ([SearchBy])
DoCmd.FindRecord [SearchVariable], , False, , False
If LastRecordFound = Me.CurrentRecord Then
response = MsgBox("There are no matching records. Sorry!", vbOKOnly, "Can't Help!")
Exit Sub
End If
response = MsgBox("Is this the correct patient?", vbYesNo, "Checking")
Do While response = 7
LastRecordFound = Me.CurrentRecord
DoCmd.FindNext
If LastRecordFound = Me.CurrentRecord Then
repsonse = MsgBox("There are no more records to search!", vbOKOnly, "End of the line!")
Exit Sub
End If
response = MsgBox("Is this the correct patient?", vbYesNo, "Checking")
Loop
Exit_Command286_Click:
Exit Sub
Err_Command286_Click:
MsgBox Err.Description
Resume Exit_Command286_Click
End Sub
As the admin, I can use that button with no problem, it's when I test it as a read-only user, the error "The Command or Action SaveRecord isn't available now". Obviously, since the button calls to save the current record and then search for the new patient, you can't save the record as a read-only user.
Does anyone know what I could replace SaveRecord with? Is there just a command to quit the current record?
Thanks