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
Expand|Select|Wrap|Line Numbers
- 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?