Good day everyone
I have a textbox "fldDocReviewDate"
First variable is subform "subfrmWIAudit" field "fldAuditTypeID"
Second variable is subform "subfrmWIAudit" field "fldAuditDate"
Third variable is +365 days
I want my textbox "fldDocReviewDate" to do this:
1. Locate the latest record in my subform "subfrmWIAudit" (based on a table: tblWIAudit) where "fldAuditTypeID" = 3
2. Check the date of that record in "fldAuditDate" and add +365 days to it.
This is what I have so far:
Problem is that it takes latest "3" record from my subform/table from all records, not the one associated to current record set. How to make it target the current recordset?
subform link is: Link master field: fldDocID
Link child field: tblWI.fldDocID
I have a textbox "fldDocReviewDate"
First variable is subform "subfrmWIAudit" field "fldAuditTypeID"
Second variable is subform "subfrmWIAudit" field "fldAuditDate"
Third variable is +365 days
I want my textbox "fldDocReviewDate" to do this:
1. Locate the latest record in my subform "subfrmWIAudit" (based on a table: tblWIAudit) where "fldAuditTypeID" = 3
2. Check the date of that record in "fldAuditDate" and add +365 days to it.
This is what I have so far:
Code:
Private Sub Form_Load()
Dim DueDate As String
DueDate = DLast("[fldauditdate]", "tblwiaudit", "fldaudittypeid= 3")
Me.fldDocReviewDate.Value = DueDate
End Sub
Problem is that it takes latest "3" record from my subform/table from all records, not the one associated to current record set. How to make it target the current recordset?
subform link is: Link master field: fldDocID
Link child field: tblWI.fldDocID