Hi, this is driving me mental if anyone can help I'd greatly appreciate it. So basically I have the following forms:
Main Form called Customers
Sub Form to Main Form called Service1
Sub Form to Main Form called ServiceDataSheet (Same as Service but in datasheet view)
If you haven't guessed already Im trying to create a split form as a sub form which isn't a feature (Thanks Microsoft!).
Anyway so when a user clicks on a record in the ServiceDataSheet form the Service form shows the detail, I have this working nicely with the following:
The problem is when the user changes records in the Service1 form (detail), the ServiceRecordSheet doesn't move when I use this:
I get a Run-time error '2445: You entered an expression that has an invalid reference to the property Form / Report.
Does anyone have any suggestions on what Im doing wrong or know a way to make a split form sub form a different way?
Cheers
Main Form called Customers
Sub Form to Main Form called Service1
Sub Form to Main Form called ServiceDataSheet (Same as Service but in datasheet view)
If you haven't guessed already Im trying to create a split form as a sub form which isn't a feature (Thanks Microsoft!).
Anyway so when a user clicks on a record in the ServiceDataSheet form the Service form shows the detail, I have this working nicely with the following:
Code:
Private Sub Form_Current()
DoCmd.RunCommand acCmdSaveRecord
Dim rst As Recordset
Set rst = Forms!Customers.ServiceDataSheet.Form.RecordsetClone
If Not IsNull(Me.ServiceID) Then
rst.FindFirst "ServiceID = " & Me.ServiceID
Forms!Customers.Service1.Form.Bookmark = rst.Bookmark
Else
Forms!Customers.Service1.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
rst.Close
Set rst = Nothing
End Sub
Code:
Private Sub Form_Current()
DoCmd.RunCommand acCmdSaveRecord
Dim rst As Recordset
Set rst = Forms!Customers.Service1.Form.RecordsetClone
'change here to reflect your key
If Not IsNull(Me.ServiceID) Then
rst.FindFirst "ServiceID = " & Me.ServiceID
Forms!Customers.ServiceDataSheet.Form.Bookmark = rst.Bookmark
Else
Forms!Customers.ServiceDataSheet.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
rst.Close
Set rst = Nothing
End Sub
Does anyone have any suggestions on what Im doing wrong or know a way to make a split form sub form a different way?
Cheers