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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Button with VBA not working when converted to accde file

Status
Not open for further replies.

iuianj07

Programmer
Joined
Sep 25, 2009
Messages
293
Location
US
Hello guys,

I just created a database for our office and we were planning to create an executable file of the database for multi-users:

In that database the startup form is a simple log in form that you enter your username and a button with VBA to login. the button is working fine in .accdb format, but when I made it an .accde format it doesn't work. But when I checked different forms within that database that has buttons to open different forms, it is working correctly.

Below is the VBA of the login button that is not working when converted to .accde format:

Private Sub Loginbtn_Click()
If Me.txtLoginName = "dpowers" Then

DoCmd.RunCommand acCmdWindowHide
DoCmd.OpenForm "Invoice"

ElseIf Not IsNull(DLookup("username", "Usernames", "[username] = '" & Me.txtLoginName & "'")) And DLookup("AdminRights", "Usernames", "[username] = '" & Me.txtLoginName & "'") = -1 Then

DoCmd.RunCommand acCmdWindowHide
DoCmd.OpenForm "AdminStartup"

ElseIf Not IsNull(DLookup("username", "Usernames", "[username] = '" & Me.txtLoginName & "'")) Then

DoCmd.RunMacro "Startup"

Else

MsgBox "Username not found"
End If
End Sub

Is there anyway from this code that could have made an effect when converted to .accde? or is it something with the Login Form properties?

Any help is greatly appreciated.

Thank you,
Iuianj07

 
For an accde to run you may have to add its loacation to the list of trusted loacations in Trust Center, and possibly digitally sign the code.

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top