Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-02-01
2
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

660 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