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 
Listbox Double Click
Ramona W 

11 years ago
I created 4 forms that are all based on RequestT.  Each form only showing the fields pertaining to that form.

I have an EmployeeF that contains buttons that will open the form that needs to be completed.  I also have a listbox (ServiceRequestListBox) that is on EmployeeF showing all of the different forms that I completed for THAT employee.  

The Listbox is Based on:  
SELECT [ServiceRequestID], [DateITNotified], [ServiceRequestType], [StatusName], [DateDone] FROM ServiceRequestForCurrentEmployeeQ ORDER BY [DateDone] DESC;

I need it setup so that when i double click on record in the listbox, it will open the record for that employee so i can see the details.  

This worked fine when i only had 1 form (RequestF) to enter information into.  

Private Sub ServiceRequestListBox_DblClick(Cancel As Integer)
On Error Resume Next
DoCmd.OpenForm "RequestF", , , "RequestID=" & RequestListBox
End Sub

But now that there is more than 1 form (NewF, TerminateF, SuspendF etc), it opens all of the forms at once whether was a record for the employee to begin with or not.

Private Sub ServiceRequestListBox_DblClick(Cancel As Integer)
On Error Resume Next
DoCmd.OpenForm "SRNewF", , , "ServiceRequestID=" & ServiceRequestListBox
DoCmd.OpenForm "SRNameF", , , "ServiceRequestID=" & ServiceRequestListBox
DoCmd.OpenForm "SRReactivateF", , , "ServiceRequestID=" & ServiceRequestListBox
DoCmd.OpenForm "SRSuspendF", , , "ServiceRequestID=" & ServiceRequestListBox
DoCmd.OpenForm "SRTerminateF", , , "ServiceRequestID=" & ServiceRequestListBox
End Sub

Is there a way to fix this?


Reply from Alex Hedley:

You are telling it to open each Form.

You would need to check if there is a record first before you open it.
You could use the DOMAIN function to check if there is a record and if so open the Form.

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/15/2026 8:12:22 AM. PLT: 1s