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
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