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 
Fields not refreshing On Load
David Yeager 
     
3 years ago
I have a form with an On Load event which uses a DLookup to set the value of a combo box and another field based on fields on another form.  The On Load is firing correctly.  I've confirmed this with a MsgBox showing me the values I'm expecting.  However, the fields on the form are not updating.  I've tried adding requery and refresh commands in different ways and they still don't work.  Where could I be going wrong?  Thanks.
Adam Schwanz  @Reply  
           
3 years ago
What is the bound column of the combo box? Is it expecting a number and you are giving it text?
John Campbell  @Reply  
     
3 years ago
Have you tried requering the actual controls on the form?  Are all the fields in that form in the control source of the form?
Try ControlName.requery
Kevin Robertson  @Reply  
           
3 years ago
Are you using the correct syntax?
FieldName = Forms!FormName!FieldName

See this video: Value From a Form
David Yeager OP  @Reply  
     
3 years ago
Thank you for the suggestions but I've realized I had the problem completely wrong.  The On Load event is firing and my MsgBox was returning the correct value for the the default. When I realized I needed to move my SetMarkup Sub inside and If it stopped returning the value and that's when I realized that my form is not showing the correct value because the If/Then isn't working.  Form opens with the focus on the correct field and msgbox confirms the script has run.  I'm not getting the msgbox from the subroutine inside the If.  I'll upload screenshots of the code.  I've checked my spelling several times.
David Yeager OP  @Reply  
     
3 years ago

David Yeager OP  @Reply  
     
3 years ago

Kevin Robertson  @Reply  
           
3 years ago
Try sending the ID to the Sub Routine (similar to my screenshot below).
Modify for your specific needs.
Kevin Robertson  @Reply  
           
3 years ago

David Yeager OP  @Reply  
     
3 years ago
Thank you, Kevin.  I'm afraid that didn't work either.  No matter what I do the only part that works is the SetFocus and MsgBox commands.  I tried moving the entire If statement to another sub and I tried just telling it to set the combo to a fixed ID other than the default and not joy.

So I made a workaround.  Since the SetFocus was working I just moved my code to the GotFocus event of that field.  Form works perfectly now.  You got me thinking in terms of moving stuff to other places and that led to my solution.  Much obliged.

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: 7/6/2026 6:28:20 AM. PLT: 0s