Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > Courses > Access > Beginner > B2 > B2 Lessons < B1 Lessons
Back to Access Beginner 2 Lessons    Comments List
Add New Appointment Upload Images   Link   Email  
Thomas Gonder       
2 years ago
At 18:15 we see the appointments for Kirk and Picore. What we don't see is adding a new appointment with the AppointmentF. The customer foreign key isn't added, so we have to copy and paste or type it in (I see the download added a combobox). Is there a way to have it populated when doing a new appointment for the filtered customer (instead of using a combobox {where an error can be made in selecting the wrong customer})? Is there a better way to do all this with VBA instead of a macro?

(I like the idea of a separate form instead of cluttered forms with subforms, so this seems a natural to do.)
Kevin Robertson            
2 years ago
Thomas Gonder       
2 years ago
Yes Kevin, that would be the place, but how do we set the default value in the AppointmentsF when it's called from the CustomerF? We would probably like to disable the combobox if the appointments form is "called" from the CustomerF. But, if the AppointmentsF is run on it's own, then we want the combobox to be enabled. I'm guessing we need to ditch the macro the wizard built for the command button and get into some "easy-not scary" (ha ha Richard) VBA code.
Scott Axton            
2 years ago
Since you are opening a new form as opposed to having it as a subform you would need to use the
Forms!FormName!FieldName   notation in the default value.  
This assumes the underlying form is still open.

See the Value From a Form video for more info.
Thomas Gonder       
2 years ago
Thanks Scott, the problem as I see it, we need a way for the AppointmentForm to know if it was called from the CustomerForm. Then we can set the default value (based on your suggestion) and disable the combo box. We don't do this if the AppointmentForm wasn't called by CustomerForm.

Tip: As to how to handle SOME of the above questions, you can see  the extended cut of:

And there is a Tip by Maggie there that I have yet to watch, but it too may be helpful for developers.
Scott Axton            
2 years ago
I'm not saying Maggie is correct, or not, but I fail to see how you can recommend her response as a good one based on the fact that you just admitted that you haven't watched it.

The solution I just gave you above takes into account what form you are calling from.  By setting the default value to the ID from the calling form it sets the ID into the Appointment forms default value.
If you are opening the AppointmentF form from the CustomerF then the value is populated.  By doing so that precludes opening the form else where without using some VBA to choose the value with a different method.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Beginner 2 Lessons.


The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/25/2024 11:20:42 AM. PLT: 1s