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 blnTrialInf
pen As Boolean
Dim blnClassInf
pen 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?
blnTrialInf
pen = SysCmd(acSysCmdGetObjectState, acForm, "frmTrialInfo") And _
acObjStateOpen
'Is the frmClassInfo form open?
blnClassInf
pen = SysCmd(acSysCmdGetObjectState, acForm, "frmClassInfo") And _
acObjStateOpen
If blnEventAdd_Open Or blnTrialInf
pen Or blnClassInf
pen Then
If blnEventAdd_Open Then
Forms("frmEventAdd").Visible = True
Forms("frmEventAdd")!cboContact.Requery
Forms("frmEventAdd")!cboSecretary.Requery
End If
If blnTrialInf
pen Then
Forms("frmTrialInfo").Visible = True
Forms("frmTrialInfo")!cboTrialRep.Requery
End If
If blnClassInf
pen Then
Forms("frmClassInfo").Visible = True
Forms("frmClassInfo")!cboJudge.Requery
End If
intCallerIX = intCallerIX - 1
Else
DoCmd.OpenForm PopCaller(), acNormal
End If
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
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 blnTrialInf

Dim blnClassInf

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?
blnTrialInf

acObjStateOpen
'Is the frmClassInfo form open?
blnClassInf

acObjStateOpen
If blnEventAdd_Open Or blnTrialInf


If blnEventAdd_Open Then
Forms("frmEventAdd").Visible = True
Forms("frmEventAdd")!cboContact.Requery
Forms("frmEventAdd")!cboSecretary.Requery
End If
If blnTrialInf

Forms("frmTrialInfo").Visible = True
Forms("frmTrialInfo")!cboTrialRep.Requery
End If
If blnClassInf

Forms("frmClassInfo").Visible = True
Forms("frmClassInfo")!cboJudge.Requery
End If
intCallerIX = intCallerIX - 1
Else
DoCmd.OpenForm PopCaller(), acNormal
End If
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