Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now