Updating data

  • Thread starter Thread starter Tara
  • Start date Start date
T

Tara

I have a form (frmCaseInfo --> tblCaseInfo) in which client case data such as
ReferralDate, StartDate, CloseDate, etc. are entered. I have another form
(frmContacts --> tblContacts) in which contacts such as face-to-face
meetings, phone calls, etc for clients are entered. I would like the field
StartDate on frmCaseInfo to be automatically filled in with the date of the
first contact. The data in tblCaseInfo could be entered up to several days
or weeks before a contact is ever made and this makes it hard for users to
remember to go back and add the start date when the time comes. Could I use
an AfterUpdate event on the form? What's the best approach?

Thanks!
 
It depends on whether you just want to display this date in an unbound
textbox on the form or if you want to actually update a column in the other
table.
I'll assume the former.
In the OnCurrent event for your frmCaseInfo, you need to run a DLookup
function to retrieve the first date in the tblContacts table and load it to
the form control. You will need to cater for the fact that there may not yet
be a date (DLookup will return a Null value).
Look up DLookup in Access HELP.

-Dorian
 
Thanks for the reply. Actually, I want to store the date in tblCaseInfo, so
I think I need another option...
 
Same answer, just make the control a bound control. Bind it to the column
where you want to save the answer.
Generally, its poor database design to store a value that can be calculated
from data stored elsewhere. You have duplication of data which can
potentially get out of sync.

-Dorian
 
Back
Top