Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Variable Field Name
Roger Da SIlva 
   
4 years ago
Hi there!
First of all, please, forgive my english... not my mother language.
I am kinda stuck with something that came across in a form I am trying to code.

So, I have a table with fields named "Task01" "Task02" "Task03"... "Task20"

Then I created a form with this table to be used as subform.

So, in the Main Form I inserted the subform and now I woant to get a value from one of the "Task" fields using a variable to make the complete name... something as Task + variable = Task05

Is it possible to do?
Kevin Robertson  @Reply  
          
4 years ago
This is not a good way of setting up your table.
What if you have more than 20 tasks?

See this video showing how to properly set up your tables for a Tasks Manager.
Roger Da SIlva OP  @Reply  
   
4 years ago
yes, I know... but this is not exactly a Task table.
It will be used for some kind of data control only or maybe I won't even use it at all.

My question is more about the challenge to know if it is possible or not.
Kevin Robertson  @Reply  
          
4 years ago
You could do something like this:

Dim Task As String
Dim X As Long
    
For X = 1 To 20
    Task = "Task" & Format(X, "00")
    MsgBox Task
Next
Roger Da SIlva OP  @Reply  
   
4 years ago
That far I got but when I try something like

frmMyOwnControl!Task = 2

I get an error saying something like "field doesn't exist".
Juan C Rivera  @Reply  
            
4 years ago
https://599cd.com/blog/display-article.asp?ID=1561

try thi  tech help
Roger Da SIlva OP  @Reply  
   
4 years ago
thank you
I will investigate a bit more :-)
Scott Axton  @Reply  
        
4 years ago
Roger -
Playing what if is very difficult and we could probably help you better if we knew what you are doing.

Rather than play 20 questions trying to figure out what it is you are wanting to do maybe you could explain a bit better with a "real world" example.  Change the names to protect personal data as needed.
You can even post a screenshot (above - Upload images) if you can put together something in word / excel / paint.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/9/2026 1:12:52 AM. PLT: 1s