Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Forms

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-28-2009, 09:04 AM
jeepfamilyva jeepfamilyva is offline Windows XP Access 2002 (version 10.0)
Novice
 
Join Date: Jun 2009
Posts: 1
jeepfamilyva is on a distinguished road
Question Passing data to sequential form fields

Here's what I need help with....

Let's say I have Form1 with the following fields:
txt1, txt2, txt3, txt4

I have Form2 where someone is going to enter info into some combo boxes and click a button to transfer the information over to Form1. Rather than specifically calling txt1, txt2, etc I want to use a loop that sequentially goes though them. The reason being is first my function is going to check to see which is the 1st empty text box before entering data. So txt1 may already have a value so we need to start with txt2. I can code it to get to the proper text box but can't get it ot pass the values so I need something that essentially does this....(this is very generic since I need only this specific piece)

Counter ' variable that tells me which txt box number is empty

Do While Counter < 5
Forms!Form1!("txt" & Counter) = "xxxxxx"
Counter = Counter + 1
Loop

I would appreciate any help that I can get. Currently I either get an error that I can't assign a value to that field or I get no error but the txt boxes on Form1 show #Name?
Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing identity values from main form to other forms hhuuhn Programming 3 06-02-2009 07:51 AM
Entering the same data into 2 fields on a form johnschof Forms 2 03-16-2009 10:19 AM
Passing a variable to a form cjamps Forms 0 03-02-2009 02:32 AM
create sequential id proudestmnky1 Programming 0 12-15-2008 09:10 PM
can't enter data in some form fields ashiers Forms 1 09-18-2008 10:37 AM


All times are GMT -8. The time now is 02:47 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.