ibgreat
09-13-2008, 08:34 AM
Alright here's the deal,
I have:
frmPerson (MainForm)
conAgencyInfo (Control on Main Form)
lstEmployment (listbox on Main Form - that show all of the person's current employers)
fsubAgencyInfo (Sub Form - shows the selected employers contact info)
I am trying to set the fsubAgencyInfo.RowSoure to a sql statement that is based on lstEmployment.Column(3). I wasn't having problems when the sql statement was based on lstEmployments bound column, but now I need to change the bound column back to the PK so other things can reference it.
The problem I am having is figuring out how to pass the rowsource to the subform. I have attempted a number of different syntaxes (some I even know wouldn't work) without any luck. Here are a few and the associated error messages (obviously these were run seperately).
Forms!fsubAgencyInfo.RowSource = strSQL ' ERROR can't find the form fsubAgencyInfo
Me!fsubAgencyInfo.RowSource = strSQL ' ERROR: can't find the field fsubAgencyInfo
Me!fsubAgencyInfo.Form.RowSource = strSQL 'ERROR: can't find the field fsubAgencyInfo
Me.conAgencyInfo.Form.RowSource = strSQL
Me.conAgencyInfo.Form!fsubAgencyInfo.RowSource = strSQL 'ERROR: can't find the field fsubAgencyInfo
The only other potentially viable option that I could see is to somehow set the parent relationship to the needed column in the listbox. But based on what I am seeing, Access doesn't seem to allow this.
I have been working at this for several days. And am very frustrated as this would seem to be straightforward:motz2: . I have posted elsewhere without any luck. You guys (inclusive of gals) have always come through....Please Help!!
I have:
frmPerson (MainForm)
conAgencyInfo (Control on Main Form)
lstEmployment (listbox on Main Form - that show all of the person's current employers)
fsubAgencyInfo (Sub Form - shows the selected employers contact info)
I am trying to set the fsubAgencyInfo.RowSoure to a sql statement that is based on lstEmployment.Column(3). I wasn't having problems when the sql statement was based on lstEmployments bound column, but now I need to change the bound column back to the PK so other things can reference it.
The problem I am having is figuring out how to pass the rowsource to the subform. I have attempted a number of different syntaxes (some I even know wouldn't work) without any luck. Here are a few and the associated error messages (obviously these were run seperately).
Forms!fsubAgencyInfo.RowSource = strSQL ' ERROR can't find the form fsubAgencyInfo
Me!fsubAgencyInfo.RowSource = strSQL ' ERROR: can't find the field fsubAgencyInfo
Me!fsubAgencyInfo.Form.RowSource = strSQL 'ERROR: can't find the field fsubAgencyInfo
Me.conAgencyInfo.Form.RowSource = strSQL
Me.conAgencyInfo.Form!fsubAgencyInfo.RowSource = strSQL 'ERROR: can't find the field fsubAgencyInfo
The only other potentially viable option that I could see is to somehow set the parent relationship to the needed column in the listbox. But based on what I am seeing, Access doesn't seem to allow this.
I have been working at this for several days. And am very frustrated as this would seem to be straightforward:motz2: . I have posted elsewhere without any luck. You guys (inclusive of gals) have always come through....Please Help!!