Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2005, 07:33 AM
Registered User
 
Join Date: Feb 2005
Location: Hobart, Tasmania, Australia.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code transfer to form!field

I am preparing a form to report on all new suggestions entered into the system by month; ie the number entered in Jan, Feb, Mar, etc.

The months are displayed in teh form as 12 fields named new_1, new_2, new_3 etc.

In the code I have obtained the numbers entered by month and stored them in an array LNew (12) as Long.

I now want to use a loop to transfer the results to the form;

eg

For i = 0 to 11

x= i + 1

Me!new_ x = Lnew (i)

Next

I am having difficulty setting up the reference to Me!new_x to change each loop to place the infotmaion on the right month field. How do I do this.

Thanks


Reply With Quote
  #2 (permalink)  
Old July 11th, 2005, 09:51 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Try Me("new_" & 1).text or Me("new_" & 1).value (I forget which).

If that doesn't work, you can (for each new iteration of the For loop) loop through all of the controls on the form through its Controls collection, checking their .Name, and when you find the one that matches what you're looking for, set a reference to that control.
If you set the variable type of the object that will hold that reference as Dim x As Textbox, then that reference will have the necessary properties to handle the manipulation you are attempting in the For loop.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to transfer value from one form to another cancertropica C# 2005 1 July 27th, 2008 02:42 PM
Transfer control value from a Form to Subform jimmy0305 Access VBA 1 March 16th, 2006 03:13 PM
Transfer of Form Values in Javascript pkdev Javascript How-To 3 June 21st, 2004 05:15 AM
how do you transfer a field value in the link doranaz Classic ASP Databases 2 December 25th, 2003 10:38 AM
Form data won't transfer to next screen wjenkins Javascript How-To 2 September 8th, 2003 10:33 PM



All times are GMT -4. The time now is 06:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.