MkIIISupra
Programmer
Okay, I can change a Forms Record source till I am blue in the face, simple, easy CAKE WALK!!!! But I cannot for the life of me seem to get a SUB Form Record Source to change...
Set up (Key components)
Form1 = frmContractInfo - Master Form with all controls
Form2 = SUB_frmMasterDistrict - SUB Form with records that can be selected as needed. This form is embedded into frmContractInfo and the one that needs to have the data source changed based on a Combo Box selection.
ComboBox1 = cboSchTy - User selects Charter or Regular to change SUB_frmMasterDistrict.RecordSource
More info, I have a Combo Box on both forms (I have tried from both forms to make this work, I only want it on the parent form (frmContractInfo) but I have been trying everthing I can think of to get this to work.
Here is how things are supposed to work:
User selects one of two choices from cboSchTy which will then change the record source for SUB_frmMasterDistrict so the user may then proceed on with their task.
Here is the VBA behind each of these Combo Boxes(one on each of the two Forms). And the error message that I am getting. Please keep in mind the error message is identical if I run this code from either form when both are open BUT if I open the SUB_frmMasterDistrict by itself the code works. It only fails when I have frmContractInfo open which in turn opens the embedded SUB_frmMasterDistrict.
Private Sub cboSchTy_AfterUpdate()
If (Me.cboSchTy) = "Charter" Then
Forms!SUB_frmMasterDistrict.RecordSource = "tblCharterSchools_DistList"
ElseIf (Me.cboSchTy) = "Regular" Then
Forms!SUB_frmMasterDistrict.RecordSource = "tblMasterDistrict"
End If
End Sub
ERROR MESSAGE BEGIN
Microsoft Visual Basic
Run-time error '2450'
Microsoft Access can't find the form 'SUB_frmMasterDistrict' referred to in a macro expression or Visual Basic Code
ERROR MESSAGE END
I have tried to Dimension the SUB_frmMasterDistrict but same error...
Dim SUB_frmMasterDistrtict As Form
What am I missing?
One by one the penguins steal my sanity!
Set up (Key components)
Form1 = frmContractInfo - Master Form with all controls
Form2 = SUB_frmMasterDistrict - SUB Form with records that can be selected as needed. This form is embedded into frmContractInfo and the one that needs to have the data source changed based on a Combo Box selection.
ComboBox1 = cboSchTy - User selects Charter or Regular to change SUB_frmMasterDistrict.RecordSource
More info, I have a Combo Box on both forms (I have tried from both forms to make this work, I only want it on the parent form (frmContractInfo) but I have been trying everthing I can think of to get this to work.
Here is how things are supposed to work:
User selects one of two choices from cboSchTy which will then change the record source for SUB_frmMasterDistrict so the user may then proceed on with their task.
Here is the VBA behind each of these Combo Boxes(one on each of the two Forms). And the error message that I am getting. Please keep in mind the error message is identical if I run this code from either form when both are open BUT if I open the SUB_frmMasterDistrict by itself the code works. It only fails when I have frmContractInfo open which in turn opens the embedded SUB_frmMasterDistrict.
Private Sub cboSchTy_AfterUpdate()
If (Me.cboSchTy) = "Charter" Then
Forms!SUB_frmMasterDistrict.RecordSource = "tblCharterSchools_DistList"
ElseIf (Me.cboSchTy) = "Regular" Then
Forms!SUB_frmMasterDistrict.RecordSource = "tblMasterDistrict"
End If
End Sub
ERROR MESSAGE BEGIN
Microsoft Visual Basic
Run-time error '2450'
Microsoft Access can't find the form 'SUB_frmMasterDistrict' referred to in a macro expression or Visual Basic Code
ERROR MESSAGE END
I have tried to Dimension the SUB_frmMasterDistrict but same error...
Dim SUB_frmMasterDistrtict As Form
What am I missing?
One by one the penguins steal my sanity!