Hello,
I've gotten myself stuck. I have a database which tracks information on tooling.
The main form is called frmToolDetail and stores the basic information about the tooling.
There is a subform called subCalEvent which is used to input information about every time the tool is calibrated.
The subform subCalEvent has its own subform called subOCal. This sub has a one to one relationship with the CalEvent form and is only used to store information if the tool is sent out to another company for calibration. So say we have a wrench, if we calibrate the wrench at our company then their will be an entry in SubCalEvent but no entry in subOcal. Now if we sent that wrench to another company for calibration then their would be an entry in both subCalEvent AND in subOCal.
The problem I have is in trying to pull up past records. On the frmToolDetail there is a button, btnLastCal.
This button loads subCalEvent to the last calibration event, it SHOULD also load the subOCal to the matching record to the subCalEvent.
However, when I click this button it will load the last calibration record from subCalEvent, but then loads a blank entry in the subOCal.
The code for btnLastCal is as follows:
Code:
Private Sub btnLastCal_Click()subCalEvent.Visible = True
With Me.subCalEvent.Form.RecordsetClone
If Not .EOF And .BOF Then
.MoveLast
Me.subCalEvent.Form.Bookmark = Bookmark
End If
End With
If Me!subCalEvent.Form!chkCalInHouse1.Value = True Then
With Me!subCalEvent.Form!subEventOCal.Form.RecordsetClone
If Not .EOF And .BOF Then
.MoveLast
Me!subCalEvent.Form!subEventOCal.Form.Bookmark = Bookmark
End If
End With
End If
If [bxIR] = 0 Then
subCalEvent.Locked = False
Else
subCalEvent.Locked = True
End If
End Sub
I assumed since the recordsetclone option works to move the first sub to the last record that it should also move the sub of the sub to the last record, but it is not working.
Any and all assistance is greatly appreciated!