Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Form On Load SetFocus Problem
Kenneth Ferguson 
     
15 days ago
I have a table to which I have added two new fields and populated them with an update query. When I add the fields to the form I use to modify entries in the table, the form will not display. I can open the form in the layout view then switch to form view and it will open. But when I just click on form wiew it will not open. Also when I click the modify button on my main form for this table it will not open.
Alex Hedley  @Reply  
           
15 days ago
Richard Rost  @Reply  
           
15 days ago
Kenneth, Alex's Troubleshooter is a good starting point. Back up the database before testing changes.

Since this started when you added the controls, check the form's Record Source in Design View. If it's a query, open that query directly and make sure both new fields are included and it runs without errors or unexpected parameter prompts. Then check that each new control's Control Source matches the intended field.

On a COPY of the form, remove just the two new controls, save and close it, then reopen it directly in Form View. Leave the table fields and their data alone. That will help narrow down whether adding those controls triggers the problem.

When you say it won't open, do you get an error message, a blank form, or no form window at all? Please post the exact error text, if any. Also let us know whether the form has an On Open or On Load macro/event procedure. The Layout View workaround is a useful clue, but it isn't enough to identify the cause yet.
Kenneth Ferguson OP  @Reply  
     
8 days ago
I do not get any error text. I get no form window at all. It has an On Load event which sets the focus to a field on the form.

It's record source is a query and I have added the two new fileds to the query. When I run the query by its self the fields are there and populated with the data. When I added the fields to the form I made sure the data source was the new field from the query.

I have also tried some of the trouble shooting in your list. I have did a compact and repair on the database and also recompiled the VBA code.
Richard Rost  @Reply  
           
3 days ago
Sorry for not getting back to you sooner, Kenneth. I've been out of the office since Monday.

That helps narrow it down. Since the query runs and the controls are bound to the right fields, I'd test the On Load code next rather than changing the table again.

On a backup copy, temporarily comment out just the SetFocus line in Form_Load, save and close the form, then open it directly in Form View. If it opens normally, we've isolated an important clue. Check that the control named in SetFocus still exists and is visible and enabled. That result would not, by itself, prove the new fields are the cause.

If it still won't display, please post the complete Form_Load procedure and any Form_Open procedure as text, including the error handler. Also let us know whether removing only the two new controls from a copy changed anything. Please leave out any private data. Those details will let us investigate the actual opening sequence instead of guessing.
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

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: 11/17/2026 3:16:04 AM. PLT: 1s