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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
On Dbl Click to Open Another Form Within a Tab
Marcelino Sanchez 
     
14 months ago
Guys I have an issue I am trying to resolve and can't figure out. I have a Continuous form (PlantListF) that I use to open my Single Form (PlantEntryF). I am able to open my PlantEntryF from the PlantListF, when I double-click the ID field of a record with no problem. I recently added a Tab Control Object to my database as my main form, so that I can tab through my forms, instead of using buttons on a small menu. The problem I now have is that when I double-click the ID field to open a record from the List, the PlantEntryF does open to the specific record, but it does so, outside of the Tab Control itself. I am not sure how to modify my VBA code to open the PlantEntryF within the assigned Tab. Is this possible?

Thank you in advance.
Sami Shamma  @Reply  
             
14 months ago
Marcelino Sanchez you are going to hate my answer.

There is a good reason Richard advises strongly not to use Tab controls. They are not perfect. They were designed for users of much less experience than you.

My advice:

Go back to controlling your code with menus.
Donald Blackwell  @Reply  
       
14 months ago
I've used tab controls in some projects, they just take some getting used to - they're not as buggy as they used to be.

When you say "outside of the tab control itself", do you mean, "they open in the same form, but not in the appropriate tab", or "they don't open in the form, the open a separate form".

In the first case, it means that you didn't get the subform control seated into the tab properly.

In the second case, it means that you're not using proper subform notation in your double-click event.

If neither, then, would need more information to be helpful
Marcelino Sanchez OP  @Reply  
     
14 months ago
The form opens but not in the appropriate tab.
Donald Blackwell  @Reply  
       
14 months ago
Would need to see what code you have in your dblclick event to be able to understand.

With tabs, if you have a form in each tab, it would have to be in a subform control and your double click event would be effectively changing the recordset or the filter of the form in that sub form.

If the sub form is loading the form correctly with your double click event inside the calling form, then it just means that the sub form isn't properly placed (seated) in the appropriate tab. That's easy enough to fix but I don't have enough info yet to determine which correction path to suggest.
Marcelino Sanchez OP  @Reply  
     
14 months ago
Donald, the code below is what I have in the DblClick event of the calling form (PlantListF) which is in one tab:

    DoCmd.NavigateTo "PlantEntryF"
    DoCmd.OpenForm "PlantEntryF", , , "PlantID=" & PlantID

My PlantEntryF is a single form.



Donald Blackwell  @Reply  
       
14 months ago
Sorry for late response, been trying to fix my mower...

DoCmd.OpenForm actually opens a separate form instead of focusing on an existing form control.

Just to make sure that I wasn't leading you the wrong way, I built a quick form to test. In my form, I put a button  that simulates the same effect as double clicking your ID field. I named the button "OpenPlantFBtn", again, just so I had something to click to adjust a form on a separate tab. My 2 tabs are "Main Page" and "PlantF".

On the "PlantF" tab, I have a subform control named "SubPlantF" with the "PlantT" table, you would set the source to your "PlantEntryF" form. In my form, there is no need to link the child and master fields.

My generic PlantF table I created simply has a "PlantID" and a "PlantName" field.

If I open my form, it opens to the "Main Page" tab. If I click the tab for "PlantF", it will show the "SubPlantF" sub form with the "PlantF" table with all records.

If I click the "OpenPlantFBtn" on the Main Page tab, it switches to the "PlantF" tab and filters the table to the Plant with ID 2.

Code for "OpenPlantFBtn":
Private Sub OpenPlantFBtn_Click()
    SubPlantF.SetFocus
    SubPlantF.Form.RecordSource = "SELECT * FROM PlantF WHERE PlantID=2"
End Sub

In your case, you would just need to use similar code in your on double click event
Marcelino Sanchez OP  @Reply  
     
14 months ago
Thank you so much for taking out the time to assist Donald. I will make the changes and try your recommendation. Have a blessed evening.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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: 6/16/2026 7:35:16 PM. PLT: 0s