L
Lee Stafford via AccessMonster.com
I know, compile the vba code.....I have searched this topic til fingers got
numb and that is the solution that everyone gives, but it doesn't solve my
problem.
When I try to open the front end, sometimes it will hang up on a bit of code
that is in the switchboard. The following is the code:
Private Sub Form_Activate()
'When the database is opened display welcome user message.
'When the timer interval is reached, this form closes and opens Switchboard
If Time() < 0.5 Then
[lblmorning].Visible = True
[lblafternoon].Visible = False
[lblevening].Visible = False
ElseIf Time() > 0.5 And Time() < 0.75 Then
[lblmorning].Visible = False
[lblafternoon].Visible = True
[lblevening].Visible = False
ElseIf Time() > 0.75 Then
[lblmorning].Visible = False <--This is where it hangs up (it
is 8:30pm when running it.)
[lblafternoon].Visible = False
[lblevening].Visible = True
End If
End Sub
Runtime error 91
object variable or with block variable not set.
Sometimes it doesn't hang up there. It doesn't give me the option to compile,
I just reset it and it is fine. The compile option is greyed out. It has
never had this problem with this code before.
Can anyone shed some light?
Thanks,
Lee
numb and that is the solution that everyone gives, but it doesn't solve my
problem.
When I try to open the front end, sometimes it will hang up on a bit of code
that is in the switchboard. The following is the code:
Private Sub Form_Activate()
'When the database is opened display welcome user message.
'When the timer interval is reached, this form closes and opens Switchboard
If Time() < 0.5 Then
[lblmorning].Visible = True
[lblafternoon].Visible = False
[lblevening].Visible = False
ElseIf Time() > 0.5 And Time() < 0.75 Then
[lblmorning].Visible = False
[lblafternoon].Visible = True
[lblevening].Visible = False
ElseIf Time() > 0.75 Then
[lblmorning].Visible = False <--This is where it hangs up (it
is 8:30pm when running it.)
[lblafternoon].Visible = False
[lblevening].Visible = True
End If
End Sub
Runtime error 91
object variable or with block variable not set.
Sometimes it doesn't hang up there. It doesn't give me the option to compile,
I just reset it and it is fine. The compile option is greyed out. It has
never had this problem with this code before.
Can anyone shed some light?
Thanks,
Lee