concatenate a subform name

checoturco

Registered User.
Local time
Yesterday, 16:08
Joined
Oct 17, 2005
Messages
76
hi list,

i´m trying concatenate a subform name without success.
i have 6 suforms with names ConsultporBrig_subform1,ConsultporBrig_subform2,....
i have a loop recorset and the recorsource for this subforms depends on current recordset value.
i already try some code(with some ideas found in this forum) but i can´t get this work.

(strsql holds the query,
ConsultBrig is the mainform)

this is some code that i try:

Forms![ConsultBrig]!("ConsultporBrig_subform" & i).Form.RecordSource = Strsql

Forms!("ConsultporBrig_subform" & i).Form.RecordSource = Strsql

Me.ConsultporBrig_subform(" & i &").Form.RecordSource = Strsql


tks in advance for your help

checo
 
Last edited:
Try the following:

me("ConsultporBrig_subform" & i).sourceobject = Strsql
 
tks allan57 for your replay,

with your code i get the error
the form name you entered dosen´t follow Microsoft Office Object-naming rules

but help me find the solution for my problem.

this code works
Me("ConsultporBrig_subform" & i).Form.RecordSource = Strsql

tks for your help
 

Users who are viewing this thread

Back
Top Bottom