Solved

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

Posted on 2013-02-01
2
337 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
ID: 38845016
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
ID: 38877569
perfect, thanks!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

911 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

15 Experts available now in Live!

Get 1:1 Help Now