Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form in Data Sheet View

Status
Not open for further replies.

MrsNic

Instructor
Feb 6, 2005
44
GB
I need to open a form in datasheet view from the switchboard. I have set all the properties correctly and followed the advice given in thread thread702-823199 the only problem is that the default switchboard opens a password form for two sets of user Admin and Pupils.

From there the switchboard option that does not need a password (pupils) opens correctly.

The Secure area that needs the password displays the error message 'there was an error executing the command'

the code on the password form is

Private Sub cmdShowAdminArea_Click()
If Me.txtPassword <> "avalon" Then
MsgBox "Incorrect Password", vbExclamation, "Access Denied"
DoCmd.Close acForm, "frmPassword"
Else
Forms!Switchboard.Filter = "[ItemNumber] = 0 And [SwitchboardID]=7"
Forms!Switchboard.Refresh
DoCmd.Close acForm, "frmPassword"
End If

End Sub

Any suggestions?

Thanks
 
This is quite confusing to me, because if either 'avalon' or no password is filled in, the second part (else ...) will run, based on the code shown above. Which line is highlighted in the code window when you get the error, because I did not get any errors in my test? The thread you reference is mainly to do with opening a form in datasheet view, I do not see how it is involved in the above code. Can you explain a little more?

It seems to me that you could avoid a few problems if the datasheet form just opened off the password form, unless the administrators area involves a lot of other stuff. I guess you know that this is not at all secure ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top