Why do I get this error?

  • Thread starter Thread starter Rachel
  • Start date Start date
R

Rachel

I have an event procedure that is supposed to open a form
when a checkbox is checked.

Private Sub Consent_obtained__Click(frm As frmAllPts)
If Me![Consent obtained?] = -1 Then
DoCmd.OpenForm "frmConsentedPts", , , , , acDialog
End If

End Sub

It used to work. Then I wanted to append (part of) the
record where the click occurred to a new table, so I
created a macro to do so. The macro didn't work. But now
when I check the checkbox, I get an error. "User-defined
type not defined."

How do I fix this? Either the user-defined error or the
entire issue would be helpful. Thanks.

-Rachel
 
Did you by any chance rename the frmAllPts form? I am thinking that
maybe frmAllPts that your code is referring to is nonexistent. This is
the only place in your code where I see any references to types.
Besides, I don't see "frm" used anywhere in the code. Why don't you
simply delete it from the parenthesis completely?

Pavel
 
Yay! It worked. Now I just need to filter the way the
form displays the info so that I'm looking at my appended
record. I may be able to figure that out on my own.

Thanks!
-----Original Message-----
Did you by any chance rename the frmAllPts form? I am thinking that
maybe frmAllPts that your code is referring to is nonexistent. This is
the only place in your code where I see any references to types.
Besides, I don't see "frm" used anywhere in the code. Why don't you
simply delete it from the parenthesis completely?

Pavel
I have an event procedure that is supposed to open a form
when a checkbox is checked.

Private Sub Consent_obtained__Click(frm As frmAllPts)
If Me![Consent obtained?] = -1 Then
DoCmd.OpenForm "frmConsentedPts", , , , , acDialog
End If

End Sub

It used to work. Then I wanted to append (part of) the
record where the click occurred to a new table, so I
created a macro to do so. The macro didn't work. But now
when I check the checkbox, I get an error. "User- defined
type not defined."

How do I fix this? Either the user-defined error or the
entire issue would be helpful. Thanks.

-Rachel
.
 
I think it should be:

Private Sub Consent_obtained__Click(frm As Form_frmAllPts)


Chris Nebinger
 
Back
Top