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 
Syntax for tab control
Eric Michalek 
    
4 years ago
I have a form (PowderF).  It is it's own form that adds, edits, and deletes my powder records.
My Main screen (MainScreenF) has a tab control (TheTab) with page (PagePowder), on that page I have a subform (PowderListingSubF) that contains a form (PowderSelectionF).

My problem: When I add a record with (PowderF) and click my command button (SaveB), I want the new record to be visible  on my (PowderSelectionF).  If I click F5 on my keyboard, the form shows the added record.
I have been blindly trying VBA variations to do what F5 does but no success. example of an attempt that does not work:
Forms!MainScreenF.Controls!TheTab.Forms!PowderSelectionF.Requery
Can you help?
Kevin Robertson  @Reply  
          
4 years ago
The first thing you need to do is make sure the record is saved to the Table.
Me.Refresh

Next you need to access the Pages property of the Tab control so access knows which page the Subform is on.

You can either refer to the Index of the page (zero-based).
Forms!FormName!TabControlName.Pages(0).Requery

Or to the name of the page.
Forms!FormName!TabControlName.Pages("Page1").Requery
Eric Michalek OP  @Reply  
    
4 years ago
I tried this but it didn't work.  Still need F5 as the form does not show the new record.
Kevin Robertson  @Reply  
          
4 years ago
The code seems to work for editing records but not when a new record is added.
I rarely use the Tab control but after some research I found that you don't actually have to reference the Tab control in your code.

Forms!FormName!SubformName.Requery

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/10/2026 12:11:43 AM. PLT: 1s