My users input data into a continuous sub form, I look at a value of a field from this sub form and dependent on what is entered into the field I have a button that emails out to different people.
Quite often the email address's are left blank, I have worked out that this is because the operator has moved to a blank record before hitting the email button.
What do i need to do to stop this form from being blank, and to look up to either the first or last value.
the highlighted field is called tbsubcat.
I have tried setting tbsubcat as a unbound control and then using VB to get the first or last value (code below), but i get the error message Compile Error Message or data member not found.
Quite often the email address's are left blank, I have worked out that this is because the operator has moved to a blank record before hitting the email button.
What do i need to do to stop this form from being blank, and to look up to either the first or last value.
the highlighted field is called tbsubcat.
I have tried setting tbsubcat as a unbound control and then using VB to get the first or last value (code below), but i get the error message Compile Error Message or data member not found.
Code:
tbSubCat.RecordSource = "SELECT tblQCNonConformanceDetail.Job_ID, Last(tblcatalog.Sub_Category) AS LastOfSub_Category " & vbCrLf & _
"FROM tblQCNonConformanceDetail INNER JOIN tblcatalog ON tblQCNonConformanceDetail.Cat_No = tblcatalog.Cat_No " & vbCrLf & _
"GROUP BY tblQCNonConformanceDetail.Job_ID " & vbCrLf & _
"HAVING (((tblQCNonConformanceDetail.Job_ID)=[Forms]![frmNonConformance]![Job_ID]));"