go to record in a subform

G

Guest

Hi,
is it possible to apply that GoToRecord method to subform.
When applied to subform on form I allways get message
subform is not open?!

The syntax I use:
DoCmd.GoToRecord acDataForm, "Forms!SomeForm![SomeSubform].Form", acGoTo, 4

The messagge I get:
the object 'Forms!SomeForm![SomeSubform].Form' isn't open.

thanx


alek_mil
 
A

Allen Browne

More or FindFirst in the RecordsetClone of the subform instead.

Example:
Dim rs As DAO.Recordset
With Me.[SomeSubform].Form
Set rs = .RecordsetClone
rs.FindFirst "City = ""Springfield"""
If rs.NoMatch Then
MsgBox "Not found"
Else
.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End With

Note that the record has to be in the subform in order to find 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