Bill Bisco
Custom User Title
- Local time
- Today, 09:30
- Joined
- Mar 27, 2009
- Messages
- 92
In the following code I am attempting to change the RecordSource of the Subform. I'm getting an error message at the line
The Current Name of the Child is frmProcessSelectLSSubform and the Current Source Object is called frmProcessSelectLSSubform
If anyone could show me how to fix this error, it would be appreciated. Below is my whole code:
Sincerely,
Bill
Code:
Me!frmProcessSelectLSSubform.RecordSource = strFormName
The Current Name of the Child is frmProcessSelectLSSubform and the Current Source Object is called frmProcessSelectLSSubform
If anyone could show me how to fix this error, it would be appreciated. Below is my whole code:
Code:
Private Sub cmdState_Click()
Dim cap As String
cap = Me.cmdState.Caption
Dim strFormName As String
Dim strFilter As String
Select Case cap
Case "View Current"
With Me
.cmdState.Caption = "View Proposed"
End With
strFormName = "frmProcessSelectCurrentLSSubform"
If IsFormLoaded(strFormName) Then
DoCmd.Close acForm, strFormName, acSaveYes
End If
DoCmd.OpenForm strFormName, acNormal, strFilter, , , acHidden
Me!frmProcessSelectLSSubform.RecordSource = strFormName
DoCmd.Close acForm, strFormName, acSaveYes
Case "View Proposed"
With Me
.cmdState.Caption = "View Current"
End With
strFormName = "frmProcessSelectLSSubform"
If IsFormLoaded(strFormName) Then
DoCmd.Close acForm, strFormName, acSaveYes
End If
DoCmd.OpenForm strFormName, acNormal, strFilter, , , acHidden
Me!frmProcessSelectLSSubform.RecordSource = strFormName
DoCmd.Close acForm, strFormName, acSaveYes
End Select
Me.Refresh
End Sub
Bill