Solved

Populate a field only if there is data in another related table...?

Posted on 2013-02-01
2
323 Views
Last Modified: 2013-02-11
I have a table that has an invoice date (tbl_qa).  I have a table that has an invoice date (tbl_invoice).  They are related through the ProjectID.  The tbl_invoice has a field called FinalPercent.  Both tables feed a seperate form (frm_qa and frm_invoice).

The user wants the qa to auto populate the invoice date ONLY if they put something in the FinalPercent field of the invoice table.

So if (of course they use forms) they put in 1/30/2013 in the invoice form and do NOT enter anything into the final percent field, nothing happens.  But if there is a date in the invoice field on the invoice form and then later on (or at that time, depends) put 75 in the final percent field, they want the invoice date on the qa table to populate with the same invoice date.

The qa form will always be open when the invoice form is open.

What is the best way to do this?

Thanks!
0
Comment
Question by:Kevin Smith
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
use the afterupdate event of  the textbox for date and the textbox for final percent in the invoice form

assuming the names of the textboxes are txtDate and txtPercent in invoice form
and txtInvoiceDate in the qa form

private sub txtDate_afterupdate()

if me.txtDate & ""<>"" and me.txtPercent & "" <> "" then
   forms!frm_qa!txtInvoiceDate= me.txtDate

end if

end sub

private sub txtPercent_afterupdate()

if me.txtDate & ""<>"" and me.txtPercent & "" <> "" then
   forms!frm_qa!txtInvoiceDate= me.txtDate

end if

end sub
0
 

Author Closing Comment

by:Kevin Smith
Comment Utility
perfect, thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Date Range Syntax Access 2003 10 44
ms/access report does not open query 20 31
MS Access 2010 Form Building 3 22
DCount using "OR" 4 16
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now