I've got a sub form that gets re-used on a number of forms. It is controlled by the same control (combobox) on each of the main forms.
The sub form gets its data from a recordsource that is an sql statement. I can get it to work by naming the main form in the criteria (ie me.cmbClientID=FrmMain.cmbclientID) but don't want to hard code the name of form.
I am struggling to get the sub form to pick up the parent form in order to use it in the SQL crieteria.
I've also tried playing around with screen.activeform but had no luck
The sub form gets its data from a recordsource that is an sql statement. I can get it to work by naming the main form in the criteria (ie me.cmbClientID=FrmMain.cmbclientID) but don't want to hard code the name of form.
I am struggling to get the sub form to pick up the parent form in order to use it in the SQL crieteria.
Code:
set frm=me.parent
strSQL="select some.fields " _
& "Where Tbl.ClientId=" & frm.cmbClientID & ";"
set rst=db.opendynaset(strSQL,dbopensnapshot)
I've also tried playing around with screen.activeform but had no luck