D
David_Williams_PG ()
Am trying to reference a Subform - "frm_find_code" in a module to cover two
different forms in which it lives ! Which are :-
"Frm_CSR_input" and "Frm_OGI_Investigation"
Easy to assign to one from only - Form_t = "Frm_CSR_input" Net below
expression is fine
Ean6_f = Forms(form_t)!frm_find_code!EAN6
But the only solution I can think of to get both variables / forms to work
is to use an SQL in the Form load procedure to write speciific form to a
table :-
DoCmd.RunSQL "UPDATE Tbl_varables " & _
"SET SetVarable = ""Frm_CSR_input"", " & _
"SetNo_Varable = 1 " & _
"WHERE Tbl_varables.Selection=1;"
and then from within the module pick up the form name :-
Set DB = CurrentDb()
Set rst = DB.OpenRecordset("SELECT Tbl_varables.SetVarable FROM
Tbl_varables " & _
" WHERE (((Tbl_varables.Selection)=1));")
rst.MoveFirst
form_t = rst.Fields("SetVarable").Value
rst.Close
This works but come on their must be an easier way !!
DW
different forms in which it lives ! Which are :-
"Frm_CSR_input" and "Frm_OGI_Investigation"
Easy to assign to one from only - Form_t = "Frm_CSR_input" Net below
expression is fine
Ean6_f = Forms(form_t)!frm_find_code!EAN6
But the only solution I can think of to get both variables / forms to work
is to use an SQL in the Form load procedure to write speciific form to a
table :-
DoCmd.RunSQL "UPDATE Tbl_varables " & _
"SET SetVarable = ""Frm_CSR_input"", " & _
"SetNo_Varable = 1 " & _
"WHERE Tbl_varables.Selection=1;"
and then from within the module pick up the form name :-
Set DB = CurrentDb()
Set rst = DB.OpenRecordset("SELECT Tbl_varables.SetVarable FROM
Tbl_varables " & _
" WHERE (((Tbl_varables.Selection)=1));")
rst.MoveFirst
form_t = rst.Fields("SetVarable").Value
rst.Close
This works but come on their must be an easier way !!
DW