Open Form to Specific Record

G

Guest

I am using a subform, populated from a table to add information <no Problem>

I have a field (autonumber ID Field) that I was trying to use an OnClick
event with to open a form to that specific record.

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me.ID

I get the following error that I have not encountered before.

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

Anyone know why I am getting this error and how to fix it?
 
D

Douglas J. Steele

You didn't just type that as the property, did you?

It needs to be in a module. Select [Event Procedure] for the property and
click on the ellipsis (...). You'll get into the VB Editor in the middle of
the a routine:

Private Sub ID_Click()

End Sub

Type that expression there, so you end up with

Private Sub ID_Click()

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me.ID

End Sub
 
G

Guest

No it is in VB and I still got the error.

The field is in a subform and it is called subFineEdit. The field name is
ID and it is the autonumber field of the table.

I still can't figure it out.
--
Thanks As Always
Rip


Douglas J. Steele said:
You didn't just type that as the property, did you?

It needs to be in a module. Select [Event Procedure] for the property and
click on the ellipsis (...). You'll get into the VB Editor in the middle of
the a routine:

Private Sub ID_Click()

End Sub

Type that expression there, so you end up with

Private Sub ID_Click()

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me.ID

End Sub
 
D

Douglas J. Steele

Are you saying that you're running that code on the parent form, and you
want to refer to a value on a subform?

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me!subFineEdit.Form!ID

Note that "subFineEdit" may not be correct there. Depending on how you added
subFineEdit as a subform on the parent form, the name of the control that
holds subFineEdit may be named something different than subFineEdit. You
want to use the name of the subform control on the parent form if it's
different than subFineEdit.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ripper said:
No it is in VB and I still got the error.

The field is in a subform and it is called subFineEdit. The field name is
ID and it is the autonumber field of the table.

I still can't figure it out.
--
Thanks As Always
Rip


Douglas J. Steele said:
You didn't just type that as the property, did you?

It needs to be in a module. Select [Event Procedure] for the property and
click on the ellipsis (...). You'll get into the VB Editor in the middle
of
the a routine:

Private Sub ID_Click()

End Sub

Type that expression there, so you end up with

Private Sub ID_Click()

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me.ID

End Sub

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ripper said:
I am using a subform, populated from a table to add information <no
Problem>

I have a field (autonumber ID Field) that I was trying to use an
OnClick
event with to open a form to that specific record.

DoCmd.OpenForm "frmFineMemo", , , "ID=" & Me.ID

I get the following error that I have not encountered before.

The expression On Click you entered as the event property setting
produced
the following error: Object or class does not support the set of
events.

Anyone know why I am getting this error and how to fix it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top