Link to home
Start Free TrialLog in
Avatar of wlwebb
wlwebbFlag for United States of America

asked on

Access - VB to copy info from a Main Form Textbox it's SubForm Textbox using Variable Name

Hello All

Have a form with several Subforms.  I have been using variables to cycle through copying info within forms but this one is a variable that copies info from one form to several  subforms.  

I know I can use Me("xxxx" & i) = Me("xxx" & i+1) within a form but can you do that from a Form to a Subform?

I have tried this and it does not like my Syntax.    I get Run-Time Error '2465' Can't fine the field '|' referred to in your expression???????


My code is
                ["sfrm_ctl_Addr" & x].Form![txtStreetName] = Me("txtStreet" & (Format(x, "00")))
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Have you tried this?


Me.SubformControlName.Form("xxxx" & i) = Me("xxx" & i+1)
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wlwebb

ASKER

Hmmmm... no!  Give me a minute.........
Avatar of wlwebb

ASKER

PERRRRFFFEEEECCCTTTTT!!!!!!!!  Thanks Mbiz!!!!!!!!!  I Really appreciate it.