Solved

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

Posted on 2012-12-27
4
349 Views
Last Modified: 2012-12-27
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
Comment
Question by:wlwebb
  • 2
  • 2
4 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 38724869
Have you tried this?


Me.SubformControlName.Form("xxxx" & i) = Me("xxx" & i+1)
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 38724873
Maybe this...

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

Open in new window

0
 

Author Comment

by:wlwebb
ID: 38724876
Hmmmm... no!  Give me a minute.........
0
 

Author Closing Comment

by:wlwebb
ID: 38724965
PERRRRFFFEEEECCCTTTTT!!!!!!!!  Thanks Mbiz!!!!!!!!!  I Really appreciate it.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question