Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

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")))
0
wlwebb
Asked:
wlwebb
  • 2
  • 2
1 Solution
 
mbizupCommented:
Have you tried this?


Me.SubformControlName.Form("xxxx" & i) = Me("xxx" & i+1)
0
 
mbizupCommented:
Maybe this...

                Me.Controls("sfrm_ctl_Addr" & x).Form![txtStreetName] = Me("txtStreet" & (Format(x, "00")))

Open in new window

0
 
wlwebbAuthor Commented:
Hmmmm... no!  Give me a minute.........
0
 
wlwebbAuthor Commented:
PERRRRFFFEEEECCCTTTTT!!!!!!!!  Thanks Mbiz!!!!!!!!!  I Really appreciate it.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now