I am trying to make available a way to save "new" old data to the database. If someone forgets to enter their verification, i need a way for the boss to be able to enter that information at a later time. The database is set to be realtime, so the fields on the form are controlled by the user clicking a save button which automatically fills the date field and they cannot adjust the date. But when someone forgets to verify their work, we have holes that need to be filled in... right now i just go into the corresponding table and add it, but i have 60+ tables and its a little tedious for the "boss" to do. I want a button on each form that he can use, that allows him to update, but no one else - via his password.
here's the catch - since I have 60+ tables, I want the button to ask for his password, and verify it with the admin table which has his password in it, if the password matches save the record and open a new record.
I thought I had it, it seems to save it, but when i step thru to make sure its working this error comes up when it hits DoCmd.Save:
Run-time error '2487':
The Object Type argument for the action or method is blank or invalid.
here's my code
It will also throw the following error when it hits the DoCmd.GoToRecor d:
Run-time error '2046'
The command or action 'GoToRecord' isn't avaialbel now.
yet if I don't have the break points it actually goes to a new record like i wanted it to. I just don't understand why its throwing errors during the step thru, and seemingly does what i want it to.
I also noticed... if i don't use the correct capitalization, it still lets it go thru, if I use the wrong word it is fine... is there a way to make it be case dependent?
here's the catch - since I have 60+ tables, I want the button to ask for his password, and verify it with the admin table which has his password in it, if the password matches save the record and open a new record.
I thought I had it, it seems to save it, but when i step thru to make sure its working this error comes up when it hits DoCmd.Save:
Run-time error '2487':
The Object Type argument for the action or method is blank or invalid.
here's my code
Code:
Private Sub cmdManualUpdate_Click()
Dim strPasswd
strPasswd = InputBox("Enter Password", "Restricted Form")
'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.
If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If
'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub
If strPasswd = DLookup("PWD", "AdminLogin") Then
Form.SetFocus
DoCmd.Save
DoCmd.GoToRecord , , acNewRec
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
Run-time error '2046'
The command or action 'GoToRecord' isn't avaialbel now.
yet if I don't have the break points it actually goes to a new record like i wanted it to. I just don't understand why its throwing errors during the step thru, and seemingly does what i want it to.
I also noticed... if i don't use the correct capitalization, it still lets it go thru, if I use the wrong word it is fine... is there a way to make it be case dependent?
Comment