N
Nick Mirro
Regardless of the date, the first form opens (> 8/31/3, frmReceivePayments).
If I switch form names, then the other form opens, like it can't get to the
second case. I tried an if/then with the same result. The entire sub is
below.
DateOfVisit and the command button running sub are on a subform.
Case 2
Me.Parent!FormToOpen = 2
Select Case Me!DateOfVisit
Case Is > 8 / 31 / 3
DoCmd.OpenForm "frmReceivePayments", _
WhereCondition:="VisitID=" & Me!VisitID
Case Is < 8 / 31 / 3
DoCmd.OpenForm "Dates and Correspondence - Form", _
WhereCondition:="VisitID=" & Me!VisitID
End Select
Private Sub btnGOTO_Click()
On Error GoTo Err_btnGOTO_Click
Select Case Me.Parent!FormToOpen
Dim frm As Form
Case 1
Me.Parent!FormToOpen = 1
DoCmd.OpenForm "frmCollections", _
WhereCondition:="PatientID=" & Me!PatientID
Set frm = Forms!frmCollections!sbfrmCollections.Form
With frm.RecordsetClone
.FindFirst "VisitID=" & Me!VisitID
If Not .nomatch Then
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
Case 2
Me.Parent!FormToOpen = 2
Select Case Me!DateOfVisit
Case Is > 8 / 31 / 3
DoCmd.OpenForm "frmReceivePayments", _
WhereCondition:="VisitID=" & Me!VisitID
Case Is < 8 / 31 / 3
DoCmd.OpenForm [Dates and Correspondence - Form], _
WhereCondition:="VisitID=" & Me!VisitID
End Select
End Select
DoCmd.Close acForm, "frmRecentBilling", acSaveNo
Exit_btnGOTO_Click:
Exit Sub
Err_btnGOTO_Click:
MsgBox Err.Description
Resume Exit_btnGOTO_Click
End Sub
If I switch form names, then the other form opens, like it can't get to the
second case. I tried an if/then with the same result. The entire sub is
below.
DateOfVisit and the command button running sub are on a subform.
Case 2
Me.Parent!FormToOpen = 2
Select Case Me!DateOfVisit
Case Is > 8 / 31 / 3
DoCmd.OpenForm "frmReceivePayments", _
WhereCondition:="VisitID=" & Me!VisitID
Case Is < 8 / 31 / 3
DoCmd.OpenForm "Dates and Correspondence - Form", _
WhereCondition:="VisitID=" & Me!VisitID
End Select
Private Sub btnGOTO_Click()
On Error GoTo Err_btnGOTO_Click
Select Case Me.Parent!FormToOpen
Dim frm As Form
Case 1
Me.Parent!FormToOpen = 1
DoCmd.OpenForm "frmCollections", _
WhereCondition:="PatientID=" & Me!PatientID
Set frm = Forms!frmCollections!sbfrmCollections.Form
With frm.RecordsetClone
.FindFirst "VisitID=" & Me!VisitID
If Not .nomatch Then
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
Case 2
Me.Parent!FormToOpen = 2
Select Case Me!DateOfVisit
Case Is > 8 / 31 / 3
DoCmd.OpenForm "frmReceivePayments", _
WhereCondition:="VisitID=" & Me!VisitID
Case Is < 8 / 31 / 3
DoCmd.OpenForm [Dates and Correspondence - Form], _
WhereCondition:="VisitID=" & Me!VisitID
End Select
End Select
DoCmd.Close acForm, "frmRecentBilling", acSaveNo
Exit_btnGOTO_Click:
Exit Sub
Err_btnGOTO_Click:
MsgBox Err.Description
Resume Exit_btnGOTO_Click
End Sub