K
klp via AccessMonster.com
I have 2 forms. My main form which has a button to open another form(search
form) and be able to select the customer that is to be viewed. I actually
didn't create this form, a co-worker did and they are new to it. Well they
renamed the form, table etc. It looks as if everything is changed correctly
but for some reason my search form is erroring out. Not sure if it's because
of the name change or something else. This selection worked before until this
name change. So, On my search form, you can select a customer and click on
the select button, which has this logic:
varID = Me.frmActionRequestSearch_subform!ARID
If IsNull(varID) Or Err.Number = 2427 Then
MsgBox "There are no matching records found, vbExclamation"
Exit Sub
End If
On Error GoTo HandleErr
Forms!frmActionRequest!cboARID = Me.frmActionRequestSearch_subform!ARID
Forms!frmActionRequest!cboARID.SetFocus
Forms("frmActionRequest").cboARID_AfterUpdate
I have done a debug and stepped through the logic to see where this was
erroring out. It happens to error out on the last line:
Forms("frmActionRequest).cboARID_AfterUpdate
When I click on the select button I get application defined or oject defined
error. I don't see why I'm getting this.
this function is there and works here is the cboARID_AfterUpdate logic
Private Sub cboARID_AfterUpdate()
On Error GoTo HandleErr
Me.RecordSource = "SELECT * FROM qryActionRequestLoad WHERE ARID = " & Nz
(Me!cboARID, 0)
If Me.frmCost.SourceObject <> "" Then
Dim frm As Form_frmCost
Set frm = Me.frmCost.Form
End If
ExitHere:
Exit Sub
HandleErr:
MsgBox Err.Description
Resume ExitHere
End Sub
Any help is very much appreciated! Thanks!
form) and be able to select the customer that is to be viewed. I actually
didn't create this form, a co-worker did and they are new to it. Well they
renamed the form, table etc. It looks as if everything is changed correctly
but for some reason my search form is erroring out. Not sure if it's because
of the name change or something else. This selection worked before until this
name change. So, On my search form, you can select a customer and click on
the select button, which has this logic:
varID = Me.frmActionRequestSearch_subform!ARID
If IsNull(varID) Or Err.Number = 2427 Then
MsgBox "There are no matching records found, vbExclamation"
Exit Sub
End If
On Error GoTo HandleErr
Forms!frmActionRequest!cboARID = Me.frmActionRequestSearch_subform!ARID
Forms!frmActionRequest!cboARID.SetFocus
Forms("frmActionRequest").cboARID_AfterUpdate
I have done a debug and stepped through the logic to see where this was
erroring out. It happens to error out on the last line:
Forms("frmActionRequest).cboARID_AfterUpdate
When I click on the select button I get application defined or oject defined
error. I don't see why I'm getting this.
this function is there and works here is the cboARID_AfterUpdate logic
Private Sub cboARID_AfterUpdate()
On Error GoTo HandleErr
Me.RecordSource = "SELECT * FROM qryActionRequestLoad WHERE ARID = " & Nz
(Me!cboARID, 0)
If Me.frmCost.SourceObject <> "" Then
Dim frm As Form_frmCost
Set frm = Me.frmCost.Form
End If
ExitHere:
Exit Sub
HandleErr:
MsgBox Err.Description
Resume ExitHere
End Sub
Any help is very much appreciated! Thanks!