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 
Form Default Values
Beau Tanner 
    
5 years ago
Please forgive me for asking so many questions. I have used Access for years, but this is the first database that I have actually built from scratch, and it is really starting to frustrate me.

I know that this is a simple fix, but I cannot figure out where I am making a mistake...

From the Main Menu, I click on "Existing Buildings"; no problems.  From the Existing Building Form, I click on "Open Selected Building"; no problems.  From the Building Form (which is where the end users will be doing 85% of the work), I click on "Design Record"; no problem.  However, when I click on "Site", it brings up the Building Site Form for "A Building"; when I click on "Water Management", it brings up that form for "A Building" as well.

I have checked the properties for "BuildingSiteF" and "WaterManagementF" both against "DesignRecordF" and I cannot figure out why the one works and the other two do not.

NOTE: the information for "DesignRecordF" comes from "BuildingT" which is my primary table.  "BuildingSiteF" and "WaterManagementF" come from "BuildingSiteT" which is a table that relates back to "BuildlingT" via the "BuildingID".  Because of the scope of the work, I will eventually have 7 more tables that relate back to "BuildingT" -- there are just so many questions/issues involved in the condition assessment of building facilities.

I have watched the Beginner and Expert (through Lvl 9) videos over and over, and for the life of me, I cannot figure out what I am doing wrong.  Any help is greatly appreciated.

If it will aid you, I'll even send you a copy of my database.
Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago
I would also note that whether I get my BuildingID info from BuildingQ or BuildingT, it does not seem to make a difference.
Richard Rost  @Reply  
          
5 years ago
Hi Beau. Your questions are always welcome. Looking at your screen shots doesn't help at all if we can't see what's inside of those buttons. Since you're an Expert user, I'm assuming you used the Command Button Wizard and there's a macro in there. Can you post a screen shot of that macro?
Adam Schwanz  @Reply  
           
5 years ago
You're almost certainly not opening the form to the specific record, not using criteria. "A building" is your first record, so it's probably just opening the form. where you need it to open the form to a specific record, need to use the criteria area
Adam Schwanz  @Reply  
           
5 years ago
Try using VBA instead and do

Docmd.OpenForm "WaterManagementF",,,"BuildingID=" & BuildingID
Adam Schwanz  @Reply  
           
5 years ago
Sorry realized I may have threw you under the bus there if you're not into VBA yet. Add a button, when the wizard pops up just push cancel. Right click on the button and click Build Event, then click CodeBuilder. Then copy/paste that code I just listed for you to try
Richard Rost  @Reply  
          
5 years ago
Beau Tanner OP  @Reply  
    
5 years ago
Okay, I am sorry.  I have been trying to focus on other parts of this project and not let my frustrations get the best of me.

If it matters, my office uses Microsoft 365 on Windows 10.

Yes, I have been using the command button wizard.  It seems fairly strait forward and easy to use; I haven't had any problems with it until now.  The formula that I have been using for the BuildingID combo box for default value is: "=[Forms]![BuildingF]![BuildingID]".  That works on my DesignRecordF.  It does not work when I get to "SiteF" ("WaterManagementF" launches from a button inside "SiteF").

@Richard: this project is the first coding that I have ever done.  I would gladly send you a screen shot of the code.  My question, though, is how do I view that code?  Which code are you looking for?

I'm sorry if I'm a little slow.  Prior to this project, my computer background has been architecture drafting software, Adobe Suite, and MSOffice Suite.  I am still wrapping my head around coding...
Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago
Is that what you are looking for? The Build Event for the Site Command Button?
Kevin Robertson  @Reply  
          
5 years ago
You're missing the Where Condition

="[BuildingID]=" & [BuildingID]
Adam Schwanz  @Reply  
           
5 years ago
Yep missing the criteria (where condition). If you put my code into the code editor for VBA or add the part kevin just added to that where condition in the macro it should open to the associated record.
Adam Schwanz  @Reply  
           
5 years ago
For clarity, when you see that screen there, that is a macro, that's what access builds by using the wizards. The code window is accessed by using the "Code Builder" instead of the "Macro Builder" when in the Events tab in the properties. They're covered really well in the Advanced lessons before you move onto the good stuff with VBA in the dev classes.
Richard Rost  @Reply  
          
5 years ago
Beau Tanner OP  @Reply  
    
5 years ago
I feel like I am in over my head, but I am making progress, and this is exciting, so thank you.

@Adam: on the BuildingF, I followed your instructions and it worked; I did, however, change the command to open "BuildingSiteF" which is what I want to open from the building form.  When I changed buildings, it still worked: it opened the correct building site form as it relates to the building form.

This is where I get tripped up:  Once I was inside the "BuildingSiteF", I tried to use the same process.  However, when I clicked on the button, I got a syntax error.  The BuildingID on the Building Site Form is a combo box that is determined by whatever building is open on the Building Form (followed along from Expert 4 Lesson 3).  Is this what is causing the syntax error?  How do I fix it?

I have a new found respect for computer programmers.  My brain hurts...
Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago

Richard Rost  @Reply  
          
5 years ago
Is the name of your combo box "BuildingID"? Chances are it's something like Combo23. Give it a name like "BuildingCombo" and then make your code:

DoCmd.OpenForm "BuildingSiteF",,, "BuildingID=" & BuildingCombo

Beau Tanner OP  @Reply  
    
5 years ago
Oh, you have got to be kidding me!  You are going to laugh at me.  I know that I'm laughing...

When using the Command Button Wizard, when prompted to "...find specific infomation to display...", I kept choosing "...show all the records..." instead of "...find specific data..." so my forms were not linking the BuildingIDs.

I feel dumb.  Does this mistake happen often?
Beau Tanner OP  @Reply  
    
5 years ago

Beau Tanner OP  @Reply  
    
5 years ago
@Richard: Yes! That worked.  I had to change "BuildingID" to "SiteBuildingIDCombo"  Success :)

You guys are amazing.  A thousand thank you's.  It's always the little things, the details.
Richard Rost  @Reply  
          
5 years ago
Yep. Common error. Don't sweat it. Until you've done it a BUNCH of times, you miss the details like that. Glad it's working. This is also why I stress:

1. Watch each video one time through WITHOUT doing anything.
2. Watch it again and follow along with my examples, building the database I build
3. Don't try to apply what you learn immediately to your projects. You're going to learn a LOT more cool stuff. Be patient.

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: 4/30/2026 10:28:59 AM. PLT: 0s