Thread: Copied some tables and forms...
06-25-08, 15:46 #1Registered User
- Join Date
- Aug 2006
Unanswered: Copied some tables and forms...
Ok, so I had a database, that PKStormy helped me out with THANKS PAUL!!!!, that works, I know it works cause I tried to get them to use it at the last job but they declined. But that's another story...
Anyways, I'm trying to reuse some of the same features on this new one. Mainly like the login of users into the database. But here's the issue...
I have a form (frmSplashScreen) which opens when the user will double-click the shortcut icon. This form has a timer for 4 seconds, in which time it pulls the user name (see code below) which is what I want it to do.
My issue is this: every time I try to get into the DB, it constantly says my "Account is marked InActive". However, it pulls the fOSUserName, which I manually put into the tables which need it in every possible manner but none seem to work.
Private Sub From_Timer() DoCmd.Close acForm, "frmSplashScreen", acSaveNo If isNewUser = True Then MsgBox "You don't have permissions to access this database. Please contact the database administrator." DoCmd.Quit Else If isAccountActive = False Then MsgBox "Your account has been marked In-Active, please contact the database administrator to correct this issue." Else DoCmd.OpenForm "frmUserLogon" End If End If End If End Sub
06-25-08, 23:33 #2L33t Helpa Munky
- Join Date
- Nov 2007
- Adelaide, South Australia
All I can tell from that code snippet is that isAccountActive is False. Without seeing more of the code behind isAccountActive, I can't even guess why.Owner and Manager of
CypherBYTE, Microsoft Access Development Specialists.
Microsoft Access MCP.
And all around nice guy!
"Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
"...teach a man to code and he'll be frustrated for life! " -- georgev
06-26-08, 06:41 #3Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
where are you setting isAccountActive
I'd suggest you insert a breakpoint before the test and examine what is in isnewuser and isaccountactive
alternatively put in a message box eg...
msgbox("isaccountactive is:" & isaccountactive & vbcrlf & "isnewuser is:" & isnewuser)
I'd also want to check the visibility of those variables.. if they are set in another module you will need to declare them as public
id also want to check that you have used "option explicit" at the head of each VBA module.. that should enforce variable checking. I dunno why microsoft even allowed it in the first place, but allowing variables to be created without declaration is a sure fire way of creating subtle hard to track down bugsI'd rather be riding on the Tiger 800 or the Norton