I get an error message. i am trying to use a technique from the Northwind model. i am using their idea on the 2nd orders subform to talk to the 1st orders subform.
I have a main form called frm-Reservation, the 1st subform is sfrmDetail and the 2nd subform is called sfrmTransaction.
i narrowed down the error to the "On Current" event of my 1st subform called sfrmDetail. i get an error "MsAccess has caused an error in Kernel32.dll. MsAccess will now close". Sometimes i also get a requery error.
I use the Northwind approach on the sfrmDetail ON Current event:
Private Sub Form_Current()
' Northwind approach
Dim strParentDocName As String
On Error Resume Next
strParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![sfrmTransaction].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Err.Description
Resume Form_Current_Exit
End Sub
========================================
by the way, i see the word Parent in this code. Should i have replaced the northwind's word Parent with my main form's name of frm-Reservation ?
On the 2nd subform named sfrmTransaction, like the Northwind, I have the Link master fields as: [sfrmDetail].Form![DetailID]
The Link Child field is: DetailID
At first, all looked like it worked well. the two detailID's matched up. but if i hit the Next button a few times, then the Kernal error message appears. I tried this on another of our machines and get same result.
thanks
Molly
I have a main form called frm-Reservation, the 1st subform is sfrmDetail and the 2nd subform is called sfrmTransaction.
i narrowed down the error to the "On Current" event of my 1st subform called sfrmDetail. i get an error "MsAccess has caused an error in Kernel32.dll. MsAccess will now close". Sometimes i also get a requery error.
I use the Northwind approach on the sfrmDetail ON Current event:
Private Sub Form_Current()
' Northwind approach
Dim strParentDocName As String
On Error Resume Next
strParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![sfrmTransaction].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Err.Description
Resume Form_Current_Exit
End Sub
========================================
by the way, i see the word Parent in this code. Should i have replaced the northwind's word Parent with my main form's name of frm-Reservation ?
On the 2nd subform named sfrmTransaction, like the Northwind, I have the Link master fields as: [sfrmDetail].Form![DetailID]
The Link Child field is: DetailID
At first, all looked like it worked well. the two detailID's matched up. but if i hit the Next button a few times, then the Kernal error message appears. I tried this on another of our machines and get same result.
thanks
Molly