swaybright
Technical User
Hi all,
Method 'Requery' of object '_subform' failed
I'm getting the above error message when I click the record navigation button to go to the first record on a form.
My form has 4 subforms. The first subform (ResinData) dictates the data viewed in the other three. I have a requery set to the OnCurrent event of the ResinData subform to update the data in other 3 subforms.
My code is:
Sub Form_Current()
Dim ParentDocName As String
On Error Resume Next
ParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![LevelData].Requery
Me.Parent![Molecule].Requery
Me.Parent![Molecule2].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub
I also have code on the oncurrent event of the main form that enables/disables some subform fields based on an option group it is:
Private Sub Form_Current()
Select Case CompoundSelect
Case 1
Forms("TSR"
("ResinData"
.Form.Controls("CPResearchID"
.Enabled = False
Forms("TSR"
("LevelData"
.Form.Controls("Level2"
.Enabled = False
Forms("TSR"
("Molecule2"
.Form.Visible = False
Case 2
Forms("TSR"
("ResinData"
.Form.Controls("CPResearchID"
.Enabled = True
Forms("TSR"
("LevelData"
.Form.Controls("Level2"
.Enabled = True
Forms("TSR"
("Molecule2"
.Form.Visible = True
End Select
If TSRNo = "" Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
End Sub
Everything works fine in terms of scrolling from record to record. I only get the error when I try to jump to the first record. After the error pops up, Access locks up.
This is really annoying. I know I can remove the navigation buttons, but that would be inconvienent to the user.
Does anyone have any IDEAS???
Shane
Method 'Requery' of object '_subform' failed
I'm getting the above error message when I click the record navigation button to go to the first record on a form.
My form has 4 subforms. The first subform (ResinData) dictates the data viewed in the other three. I have a requery set to the OnCurrent event of the ResinData subform to update the data in other 3 subforms.
My code is:
Sub Form_Current()
Dim ParentDocName As String
On Error Resume Next
ParentDocName = Me.Parent.Name
If Err <> 0 Then
GoTo Form_Current_Exit
Else
On Error GoTo Form_Current_Err
Me.Parent![LevelData].Requery
Me.Parent![Molecule].Requery
Me.Parent![Molecule2].Requery
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub
I also have code on the oncurrent event of the main form that enables/disables some subform fields based on an option group it is:
Private Sub Form_Current()
Select Case CompoundSelect
Case 1
Forms("TSR"
Forms("TSR"
Forms("TSR"
Case 2
Forms("TSR"
Forms("TSR"
Forms("TSR"
End Select
If TSRNo = "" Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
End Sub
Everything works fine in terms of scrolling from record to record. I only get the error when I try to jump to the first record. After the error pops up, Access locks up.
This is really annoying. I know I can remove the navigation buttons, but that would be inconvienent to the user.
Does anyone have any IDEAS???
Shane