I want to refer them based on the users selections on the main form
refering means i want to change the background colors and i want to block some controls which i am able to do in the main form - but i cannot refer to the subform.
Function PutValInMem()
Dim dbs As Database, rst As Recordset
Dim frm As Form, ctl As Control
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Table2", dbOpenDynaset)
Set frm = Forms![JP I]
On vnZ GoSub UDMemTbl
Set frm = Forms![JP I]![JP II] <---------'ERROR
On vnZ GoSub UDMemTbl
Else
Exit Function
End If
GoTo EndHere
UDMemTbl:
For Each ctl In frm.Controls
.... playing with controls in here
Next ctl