Solved

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

Posted on 2012-12-27
4
347 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

770 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