Solved

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

Posted on 2013-02-01
2
347 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 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