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 
Open form to specific record
Teri Bridges 
    
4 years ago
Hi, I have yet another question. I have a sub form that list courses by developer. So this form shows a list of courses assigned to the developer. What I want to do is open the main course form to the specific course when the user clicks the course ID in the sub form. I can get the main course form to open using
DoCmd.OpenForm "frmCourseDetails", WhereCondition:="[CourseID]=" & Me!CourseID

But it does not go to the specific record. It opens the form for new entry. I think this is because on the main form I have it set to "on load new entry".
I do not know if I need to add more code to what I currently have or if I can even achieve what I want.
Richard Rost  @Reply  
          
4 years ago
That should work. You can simplify your code a little:

DoCmd.OpenForm "frmCourseDetails",,, "CourseID=" & CourseID

(I can always tell when people learned from me or somewhere else just by how you write code. LOL)

But yes, if the form is set to Data Entry then you'll have to change that.
Teri Bridges OP  @Reply  
    
4 years ago
Humm, I was hoping that was not the answer.

I want the main form, when access to open to form entry, but if the user accesses via the assignment sub form I wanted it to take them directly to their assignment.
Richard Rost  @Reply  
          
4 years ago
Set Data Entry to no. If you open it from whatever other menu form you're using, just set the Data Entry property in the OpenForm command (it's one of the parameters). See Data Entry.
Teri Bridges OP  @Reply  
    
4 years ago
LOL, I tried that but then it negates my search function on the main form if they want to search for a record.
Can I have two forms with the exact information? Let's say the main form and then an update form and I would link my update form to the sub form?
Richard Rost  @Reply  
          
4 years ago
You *could* but that's not very elegant. I'd really have to see more of what you've got going on there to tell you for sure. Screen shots would help.
Teri Bridges OP  @Reply  
    
4 years ago
Ok I will try to chunk out what I am doing.
My course details form is the main form, when you open it you can enter new course details or search for an existing course. I set this main form to 'On Load' new record. That way someone would not accidently edit the first record.
The data base is used by a verity of people on the project.
What the team asked for was to link the course and event assignments to the contact.
I created a subform based on an assignment query I created.
I added that assignment subform to my contacts form as a tabbed sub form.
Now the user can lookup their name and see all their assignments for the project.(works)
What I want to do from there, is link the assignment ID back to the main form, but because I have my main form set to new record on load it does not go the the specific record on the main form. It does exactly what I told it to do,LOL, loads to new record.
If I take the on load function off it works perfectly, but that leaves the first record open to ac
Kevin Yip  @Reply  
     
4 years ago
Set the main form to visible or invisible as you see fit.  Don't use On Load, since it doesn't serve your purpose in this case.  Keep the main form "opened," but set its visibility with VBA when needed.  That would serve your purpose of preventing others to see your main form perfectly.  Invisible forms and controls can still be controlled with VBA.  They just can't get focus.  Use SetFocus on them and you get a run-time error.

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: 5/6/2026 7:48:45 PM. PLT: 0s