Hi, I could really use some help cause i am going crazy. I have a form with multiple subforms.
Behind one of the subforms i have this code:
If Me.Parent.VA_Subform___tijden_per_taak.Form.IsLoaded Then
This row gives the problem. On switching of rows in subform 1 there hase to be an action done on SF 2. It works but the error is that when i open the form for the first time it says that it cannot do stuff with the rcs recordset. I am guessing because the SF2 is not rendered yet and so not questionable. When i skip the error , everything seems to work fine. So i figured that i should check if SF2 exists before trying to clone it. I have tried several ways but none seems to work. Anyone? tnx in advance.
Ben
Behind one of the subforms i have this code:
Code:
Private Sub Form_Current()
Dim taak_id As Integer
Dim rcs As DAO.Recordset
Dim s As String
taak_id = Me.taak_fk
Me.Parent.Form.currenttaak.Value = Me.taak_fk
sessie_fk = Me.Parent.sessie_id
If Me.Parent.VA_Subform___tijden_per_taak.Form.IsLoaded Then
Set rcs = Me.Parent.VA_Subform___tijden_per_taak.Form.RecordsetClone
s = "[taak_fk]=" & Str(taak_id) & " AND [sessie_fk]=" & Str(sessie_fk) & ""
rcs.FindFirst s
If rcs.NoMatch = True Then 'niet gevonden
rcs.AddNew
Else
Me.Parent.VA_Subform___tijden_per_taak.Form.Bookmark = Me.Parent.VA_Subform___tijden_per_taak.Form.RecordsetClone.Bookmark
Me.Parent.Mediaplayer.currentPosition = Parent.VA_Subform___tijden_per_taak.Form.start
End If
rcs.Close
End If
End Sub
If Me.Parent.VA_Subform___tijden_per_taak.Form.IsLoaded Then
This row gives the problem. On switching of rows in subform 1 there hase to be an action done on SF 2. It works but the error is that when i open the form for the first time it says that it cannot do stuff with the rcs recordset. I am guessing because the SF2 is not rendered yet and so not questionable. When i skip the error , everything seems to work fine. So i figured that i should check if SF2 exists before trying to clone it. I have tried several ways but none seems to work. Anyone? tnx in advance.
Ben