Form Auto Populate

P

PleaseHelpMe

I hope this makes sense...

My frmEmployeeMain contains one subform, frmProbation. Within frmProbation,
there are three subforms, frmProb1, frmProb2, frmProb3. Each of these three
subforms has a CompletionDate field. These three subforms were created by
three queries from ONE table, tblProbation.

The frmEmployeeMain was created from tblEmployeeInfo. In tblEmployeeInfo and
frmEmployeeMain, there is a LastReportReceived field.

The EmployeeID is the related record in all these forms and tables.

Is it possible to automatically populate the LastReportReceived field with
the most current date entered in any of the three Prob subforms, and also
allow the LastReportReceived field to be edited?
 
J

Jeanette Cunningham

You can use the after update event of each subform to set the date on the
main form.

Code the after update event of each subform would be something like this,
Me.Parent.DateControlName = Me.DateControlName

To make sure you get the most recent date, something like this:

If Not IsNull(Me.Parent.DateControlName) Then
If Me.DateControlName > Me.Parent.DateControlName Then
Me.Parent.DateControlName = Me.DateControlName
End If
Else
Me.Parent.DateControlName = Me.DateControlName
End If

Note: replace my object names with your own names.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top