S
stefania nj
Hi,
I've been struggling with this all morning and can't find an event.
I am building a questionnaire management system.
The main menu (frmMain) shows the logged in user which databases he/
she has access to.
From there they can click on the icon of the database they want to
enter and the main menu for that database (frmDatabase) will display.
All this works great.
However the users that have only one database they want to skip the
opening form (frmMain) and go directly to the database menu
(frmDatabase).
in the current event of frmMain I have the following code:
if the number of databases associated with the user is 1 opens the
frmDatabase
Private Sub Form_Current()
If u.dbCount = 1 Then
DoCmd.OpenForm "frmDatabase"
Else
DoCmd.Maximize
End If
End Sub
This works fine.
What does not work is the following
on the open event of frmDatabase I have the following code
Private Sub Form_Open(Cancel As Integer)
If u.dbCount = 1 Then
DoCmd.Close , "frmMain"
End If
end sub
Which does not work, Why. I tried on all possible for events even in
frmMain.
what happens is that the frmMain is displayed no matter what. How can
achieve my goal?
frmMain is fired on the application start-up event.
Thank you,
Stefania
PS I am using Access 2003
I've been struggling with this all morning and can't find an event.
I am building a questionnaire management system.
The main menu (frmMain) shows the logged in user which databases he/
she has access to.
From there they can click on the icon of the database they want to
enter and the main menu for that database (frmDatabase) will display.
All this works great.
However the users that have only one database they want to skip the
opening form (frmMain) and go directly to the database menu
(frmDatabase).
in the current event of frmMain I have the following code:
if the number of databases associated with the user is 1 opens the
frmDatabase
Private Sub Form_Current()
If u.dbCount = 1 Then
DoCmd.OpenForm "frmDatabase"
Else
DoCmd.Maximize
End If
End Sub
This works fine.
What does not work is the following
on the open event of frmDatabase I have the following code
Private Sub Form_Open(Cancel As Integer)
If u.dbCount = 1 Then
DoCmd.Close , "frmMain"
End If
end sub
Which does not work, Why. I tried on all possible for events even in
frmMain.
what happens is that the frmMain is displayed no matter what. How can
achieve my goal?
frmMain is fired on the application start-up event.
Thank you,
Stefania
PS I am using Access 2003