Randomblink
The Irreverent Reverend
- Local time
- Today, 02:16
- Joined
- Jul 23, 2001
- Messages
- 279
Public Function SetGenerics(frm As Form, ctl As Control, Optional subfrm As Control)
Dim strColCnt As Integer, strColWdt As String, strRow As String, strTag As String, strlbl As String
Dim ctrl As Control, lblADD As Label, lstADD As ListBox, lblDELETE As Label, lstDELETE As ListBox
On Error GoTo Err_SetGenerics
Set ctrl = Forms!frm.Controls!subfrm
With ctrl
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
End Function
Here is how I call it:
SetGenerics Me, cmbSelectProjectAssignments, subform_GenericListing
or :
Call SetGenerics (Me, cmbSelectProjectAssignments, subform_GenericListing)
Either one gives me the same thing...
Ok...
obviously, the REAL function does a whole lot more...
But, this ONE line keeps giving me a real pain...
It says:
Microsoft Access cannot find the form 'frm' referred to in a macro expression or Visual Basic Code.
What am I doing wrong...????!!!!
I tried swapping out the lines:
Set ctrl = Forms!frm.Controls!subfrm
With ctrl
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
with:
With frm!subfrm
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
But then it can't find the field 'subfrm' yadda yadda yadda...
Where have I failed oh great ones...???
Dim strColCnt As Integer, strColWdt As String, strRow As String, strTag As String, strlbl As String
Dim ctrl As Control, lblADD As Label, lstADD As ListBox, lblDELETE As Label, lstDELETE As ListBox
On Error GoTo Err_SetGenerics
Set ctrl = Forms!frm.Controls!subfrm
With ctrl
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
End Function
Here is how I call it:
SetGenerics Me, cmbSelectProjectAssignments, subform_GenericListing
or :
Call SetGenerics (Me, cmbSelectProjectAssignments, subform_GenericListing)
Either one gives me the same thing...
Ok...
obviously, the REAL function does a whole lot more...
But, this ONE line keeps giving me a real pain...
It says:
Microsoft Access cannot find the form 'frm' referred to in a macro expression or Visual Basic Code.
What am I doing wrong...????!!!!
I tried swapping out the lines:
Set ctrl = Forms!frm.Controls!subfrm
With ctrl
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
with:
With frm!subfrm
.SourceObject = somevariable
.LinkMasterFields = somevariable
.LinkChildFields = somevariable
End With
But then it can't find the field 'subfrm' yadda yadda yadda...
Where have I failed oh great ones...???