gold007eye
Registered User.
- Local time
- Today, 07:26
- Joined
- May 11, 2005
- Messages
- 260
Could someone please help me figure out what I am doing wrong here?
When I open the database it keeps telling me "Run-time error '5'" Invalid Call or Procedure. I can't figure out what I have done wrong. In the "Tools/Startup" options I have the title set as "Financial Database" same as what I am using for the AppActivate command. Can someone tell me what I am doing wrong.
Also is there a way to automatically detect the title w/out using API?
When I open the database it keeps telling me "Run-time error '5'" Invalid Call or Procedure. I can't figure out what I have done wrong. In the "Tools/Startup" options I have the title set as "Financial Database" same as what I am using for the AppActivate command. Can someone tell me what I am doing wrong.
Also is there a way to automatically detect the title w/out using API?
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Form_Open_Err
DoCmd.RunCommand acCmdAppMinimize
AppActivate "Financial Database"
DoCmd.RunMacro "Toolbars Off"
'On open set focus to combo box
[cboEmployee].SetFocus
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
[lblAfternoon].Visible = False
[lblEvening].Visible = True
End If
Form_Open_Exit:
Exit Sub
Form_Open_Err:
If Err = 10 Then 'Issue with AppActivate
Exit Sub
Else:
MsgBox Err.Number & " - " & Err.Description
Resume Form_Open_Exit
End If
End Sub