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 
Form field doesnt show value
Peter van Soest 
    
4 years ago
Totally in the dark here.
I'v got a form on wich I make tax calculations. There is a  table as recordsource, but I also use several Unbound textfields in which I store/present the outcome of the calculation.

So far so good, the form workes fine.

But now, when I added some unbound text fields to show additional outcome of calculations I can't get the form field to show the values, the fields just remains empty!

I know the value is there, because when I use a msgbox to present the outcome it shows the correct value, but the field on the form remains empty.


this is the VBA code
Calc20Btn_Click 'runs the calculation

txt2020 = Belasting - Heffingskortingen + Tariefaanpassing + ZVW + BelastingBox3 - txtVoorheffing - txtVoorlopigIB - txtVoorlopigZVW

MsgBox "Bedrag 2020:" & txt2020

the MsgBox shows the correct value which is stored in the variable txt2020
but the txt2020 field remains empty!

Other strange thing, when I add .value to the name, so txt2020.value=......  instead of just txt2020=.....
I get a compile error: Invalid qualifier.

I also tried a copy of a working unbound field and changed that name to txt2020, but that alsno doesn't work.

Absolutely no idea what I could be doing wrong here, please advice!

tnx Peter

Peter van Soest OP  @Reply  
    
4 years ago

Peter van Soest OP  @Reply  
    
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
Have you also declared txt2020 as a local variable? Ensure any variable you declare don't have conflicting names.
Peter van Soest OP  @Reply  
    
4 years ago
Yes:  Dim txt2020 As Long
but you know what, I just noticed that the unbound fields that DO work are NOT declared,  but are all writen with .value to the name.  I changed the other fields likewise and no it works!  Still don't understand why the first method didn't work though...:)


Kevin Robertson  @Reply  
          
4 years ago
You don't have to declare variables for your unbound fields.
See this video on Variables.
Peter van Soest OP  @Reply  
    
4 years ago
Ahhhh off course! I was declaring variables that weren't variables but fields... :)  tnx!!

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/8/2026 10:42:04 PM. PLT: 0s