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 
Creating a record using query results from a form
Noah 

16 years ago
First of all, thank you so much for your help. I have searched for 2 days, and have been unable to find an answer to a seemingly simple question. Second, my experience level I would say is intermediate.

I have 2 tables and a form that I am working with. One table includes customer/order details (shoppingcart_extended), and the other table contains fields for following up with customers (dbo_tblCustomerFollowUps). I have a form (CustomerFollowUpAdd) that displays query results from shoppingcart_extended based off of a set of criteria that qualifies customers for a possible follow-up phone call.

I need to add a record to the "dbo_tblCustomerFollowUps" table by clicking on a button on the CustomerFollowUpAdd form. The action should create a new record and fill the fields for
"Type"-unlinked combo box,
"Email"-qry result,
"Date"-Now()…on form as “default value” for field on form,
"OrderID"-qry result.

The remaining fields in the dbo_tblCustomerFollowUps table can be left alone for updating later.

The fields in the "dbo_tblCustomerFollowUps" table are: FollowupID (Prim Key), Type, Notes, Email, Date, OrderID, CompletedFlag, RepID.

The fields on the query result form are:
SumOfTotalOrders –Sum of orders grouped by email address
CountOfNoshowid – count of orders grouped by email address
LastOfNoShowid – most recent order #
Email – query results grouped by this field
LastOfBillingName – most recent customer first name
LastOfBillingLastName – most recent customer last name
Type – Unbound combo box
Date – Unbound text box w/default value of Now()

Thank you again for your help. I greatly appreciate it.


Answer from Richard Rost:

So you need to open up one form from another form and set some values? You can do this easily with a few lines of VB code in a button.

Docmd.Openform "Form2"
Forms!Form2!FirstName = Me!FirstName
Forms!Form2!LastName = Me!LastName
etc.

For more help on this, see:

If you want to refer to a value on a Form, you can use the notation:

Forms!FormName!FieldName

You can use this notation inside of queries, other forms, or even reports. I have a free tutorial that explains how to use this:

http://599cd.com/tips/access/forms-formname-field-notation?key=BlFAlEx

Note that if you're refering to a value on a SUBFORM, the correct notation is:

Forms!FormName!SubForm.Form!FieldName

Crazy, I know. Enjoy! Hope this helps.

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: 6/10/2026 12:42:45 AM. PLT: 0s