By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Unable to make form visible again

P: n/a
Greetings. I have three forms that are open at the same time. They are
related and cascading. The first form (frmEventAdd) is the anchor. Each
event can have many Trials. The second form is frmTrialInfo. Each Trial
can have three Classes. The third form is frmClassInfo. These forms are
used for update and adding new records.

The user displays an event for update (frmEventAdd). Then clicks on a
button to display the Trials for that event (opens frmTrialInfo).
frmTrialInfo displays information for one Trial at a time. The user
clicks on a button to display class information for that trial
(frmClassInfo).

One of the fields on frmClassInfo is called cboJudge. It's a combobox
with names of Judges (judges of dog competitions). The judge information
in the combobox comes from two tables: tblPeople and tblJudges. If the
user wants to add a new judge they may click on the btnNewJudge.
btnNewJudge will open a form that is used to add a new person
(frmPeople).

Because frmPeople is opened from many different points in the
application, I found it easier to simply make the three, already opened,
forms INVISIBLE.
So...command button btnNewJudge opens frmPeople and makes frmEventAdd,
frmTrialInfo, and frmClassInfo INVISIBLE.

When frmPeople is closed (btnClose), it checks to see if each of the
previously opened/visible windows is open and then makes each VISIBLE,
again. frmEventAdd and frmTrialInfo reappear just fine. However
frmClassInfo does not.

I have traced the btnClose_Click routine in frmPeople and it certainly
looks like every line of code is being hit, but the line that should
make frmClassInfo visible does not do anything (nor does it generate any
error).

Here is the code from btnClose_Click in frmPeople. Can you help me?

********************************************
Greetings. I have three forms that are open at the same time. They are
related and cascading. The first form (frmEventAdd) is the anchor. Each
event can have many Trials. The second form is frmTrialInfo. Each Trial
can have three Classes. The third form is frmClassInfo. These forms are
used for update and adding new records.

The user displays an event for update (frmEventAdd). Then clicks on a
button to display the Trials for that event (opens frmTrialInfo).
frmTrialInfo displays information for one Trial at a time. The user
clicks on a button to display class information for that trial
(frmClassInfo).

One of the fields on frmClassInfo is called cboJudge. It's a combobox
with names of Judges (judges of dog competitions). The judge information
in the combobox comes from two tables: tblPeople and tblJudges. If the
user wants to add a new judge they may click on the btnNewJudge.
btnNewJudge will open a form that is used to add a new person
(frmPeople).

Because frmPeople is opened from many different points in the
application, I found it easier to simply make the three, already opened,
forms INVISIBLE.
So...command button btnNewJudge opens frmPeople and makes frmEventAdd,
frmTrialInfo, and frmClassInfo INVISIBLE.

When frmPeople is closed (btnClose), it checks to see if each of the
previously opened/visible windows is open and then makes each VISIBLE,
again. frmEventAdd and frmTrialInfo reappear just fine. However
frmClassInfo does not.

I have traced the btnClose_Click routine in frmPeople and it certainly
looks like every line of code is being hit, but the line that should
make frmClassInfo visible does not do anything (nor does it generate any
error).

Here is the code from btnClose_Click in frmPeople. Can you help me?

********************************************

Private Sub btnClose_Click()
On Error GoTo Err_btnClose_Click

Dim blnEventAdd_Open As Boolean
Dim blnTrialInfo_Open As Boolean
Dim blnClassInfo_Open As Boolean

blnSecondChance = False

If blnDataChanged = True Then
If DataHasChanged() = vbYes Then
Call btnSave_Click
End If
End If
'================================================= ======================
=================
'blnSecondChance=False = NO SECOND CHANCE ... Close this Form
'blnSecondChance=True = USER GETS A SECOND CHANCE ... Do NOT Close
this Form

'================================================= ======================
=================
If blnSecondChance = False Then
'Zero out Relative Record Number from Array
svRecNo(intCallerIX) = 0
blnDoUpdate = False
blnDataChanged = False
DoCmd.Close acForm, Me.Name

'Is the frmEventAdd form open?
blnEventAdd_Open = SysCmd(acSysCmdGetObjectState, acForm,
"frmEventAdd") And _
acObjStateOpen
'Is the frmTrialInfo form open?
blnTrialInfo_Open = SysCmd(acSysCmdGetObjectState, acForm,
"frmTrialInfo") And _
acObjStateOpen
'Is the frmClassInfo form open?
blnClassInfo_Open = SysCmd(acSysCmdGetObjectState, acForm,
"frmClassInfo") And _
acObjStateOpen

If blnEventAdd_Open Or blnTrialInfo_Open Or blnClassInfo_Open
Then
If blnEventAdd_Open Then
Forms("frmEventAdd").Visible = True
Forms("frmEventAdd")!cboContact.Requery
Forms("frmEventAdd")!cboSecretary.Requery
End If
If blnTrialInfo_Open Then
Forms("frmTrialInfo").Visible = True
Forms("frmTrialInfo")!cboTrialRep.Requery
End If
If blnClassInfo_Open Then
Forms("frmClassInfo").Visible = True
Forms("frmClassInfo")!cboJudge.Requery
End If
intCallerIX = intCallerIX - 1
Else
DoCmd.OpenForm PopCaller(), acNormal
End If

'DoCmd.OpenForm PopCaller(), acNormal
End If

Exit_btnClose_Click:
Exit Sub

Err_btnClose_Click:
Call ShowError("frmPeople", "btnClose_Click", Err.Number,
Err.Description)
Resume Exit_btnClose_Click

End Sub

******************************************

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Susan Bricker" <su*************@citigroup.com> wrote in message
news:y9**************@news.uswest.net...

When frmPeople is closed (btnClose), it checks to see if each of the
previously opened/visible windows is open and then makes each VISIBLE,
again. frmEventAdd and frmTrialInfo reappear just fine. However
frmClassInfo does not.

I have traced the btnClose_Click routine in frmPeople and it certainly
looks like every line of code is being hit, but the line that should
make frmClassInfo visible does not do anything (nor does it generate any
error).

Here is the code from btnClose_Click in frmPeople. Can you help me?

Hi Susan, just a shot in the dark but have you tried this configuration:

If blnEventAdd_Open Then
Forms("frmEventAdd").Visible = True
Forms("frmEventAdd")!cboContact.Requery
Forms("frmEventAdd")!cboSecretary.Requery
End If
If blnTrialInfo_Open Then
Forms("frmTrialInfo").Visible = True
Forms("frmTrialInfo")!cboTrialRep.Requery
End If
If blnClassInfo_Open Then
Forms("frmClassInfo").Visible = True
Forms("frmClassInfo")!cboJudge.Requery
End If
intCallerIX = intCallerIX - 1

If blnEventAdd_Open Or blnTrialInfo_Open Or blnClassInfo_Open
Then DoCmd.OpenForm PopCaller(), acNormal

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #2

P: n/a
Keith,

Thanks for the suggestion. But that won't work too well. If any of the
three forms is open I don't want to execute that docmd.openform. That's
the flow when frmPeople was opened from another form (that I had
previously closed ... therefore needed to reopen).

Again, thanks for the suggestion.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

P: n/a
"SueB" <sl*****@verizon.net> wrote in message
news:lp**************@news.uswest.net...

Again, thanks for the suggestion.

My mistake Susan, the last line of my suggestion should have read:

If Not blnEventAdd_Open And Not blnTrialInfo_Open And Not blnClassInfo_Open
Then DoCmd.OpenForm PopCaller(), acNormal

Clutching at straws as I can't really see anything wrong with your code.

Regards,
Keith.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.