Rick,
Hi. Here's the Form_Current( ) and Form_Load( ) routines from the
subform sfrmTrialInfo:
More Info:
Mainform = frmEvents (based on tblEvents)
Subform control = subfrmTI
Subform name = sfrmTrialInfo (based on tblTrials)
In sfrmTrialInfo:
Subform control = subfrmTCI
Subform name = sfrmTrialClass (based on TblTrialClass)
Relationships:
Events->Trials (1 to many)
Trials->Classes (1 to many)
*====================================*
Private Sub Form_Current()
On Error GoTo Err_Form_Current
Dim intCount As Integer
Dim db As DAO.Database
Dim rsT As DAO.Recordset
Dim strSQL As String
If blnYesRecords Then 'If there are TRIAL RECORDS then do the
following
If strMode = "BROWSE" Or strMode = "UNKNOWN" Then
'Find out if there are any records in tblTrialClass for this
Trial
intCount = DCount("[trialclassID]", _
"tblTrialClass", _
"[trialID] = " & Me![trialID])
If intCount = 0 Then
' Display message that says there are no Classes for
this Trial
Me![lblNoClassRecs].Visible = True
Me![subfrmTCI].Visible = False
Else
Me![lblNoClassRecs].Visible = False
Me![subfrmTCI].Visible = True
End If
Me![cboTrialRep] = Me![repID]
End If ' End of BROWSE/UNKNOWN Mode
'Me![cboTrialRep] = Me![repID]
End If ' End of YES TRIAL RECORDS EXIST
Exit_Form_Current:
Exit Sub
Err_Form_Current:
Call ShowError("sfrmTrialInfo", "Form_Current", Err.Number,
Err.Description)
Resume Exit_Form_Current
End Sub
*===================================*
Private Sub Form_Load()
'Find out if we have any Trial Records
If Me.RecordsetClone.EOF Then
blnYesRecords = False
Else
blnYesRecords = True
End If
End Sub
*===================================*
In the Form_Current( ) routine, the variable strMode is, indeed,
"BROWSE" (setup in previous form). It's a global variable defined in a
CommonProcs module that I have for common routines.
Thanks.
Regards,
SueB
*** Sent via Developersdex
http://www.developersdex.com ***