Thank you again Jeannette.
But this code you send to me works well when you are dealing with the main
form and its combos; actually, I have other forms in my program
syncronized
in that way and they work perfectly.
The problem, in this case, is that I´m trying to synchronize the records
of
a subform, so, as I´d learned once and it used to work before I change to
Office 2007, the sentence should be:
rst.FindFirst "[ID]=" & int
If Not rst.NoMatch Then
Me!subform.form.Bookmark = rst.Bookmark
End If
But, as I tell you before, for a strange reason I´m trying to find out,
this
is not working anymore...
Jeanette Cunningham said:
Assuming that the combo is on the main form and the link master and link
child fields are set up correctly,
the following code should do what you want.
rst.FindFirst "[ID]=" & int
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Jose Antonio Vial said:
Hi Jeannette, and thanks for your help!, but the problem remains.
I do what you tell me, but the code is still sending me the same
error...I
think the "FindFist" sentenece is workig good, becouse the message
error
appears later on the code, just on the "bookmark" sentence.
I´m affraid that the problem is trying to synchronize a form with a
subform,
but the strange thing is that it used to work with Access 2003 and now,
with
Access 2007 it doesn´t work anymore...
:
Hi Jose,
runtime error 2001, "You canceled the previous operation".
is Access's way of telling you that it could not find a match using
FindFirst.
When you use FindFirst, you must always test for NoMatch before you
set
the
bookmark, like this-->
rst.FindFirst "[ID]=" & int
If Not rst.NoMatch Then
Forms![mainform]![subform].Form.Bookmark = rst.Bookmark
End If
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"Jose Antonio Vial" <Jose Antonio (e-mail address removed)>
wrote
in
message I´ve problems to synchronize subforms with access 2007. Runnig the
same
old
code that worked with Acess 2003:
Dim int As Integer
Dim rst As Dao.Recordset
int=Me.[ID]
Set rst = Forms![mainform]![subform].Form.RecordsetClone
rst.FindFirst "[ID]=" & int
Forms![mainform]![subform].Form.Bookmark = rst.Bookmark
Now, with Acces 2007, I get a runtime error 2001, "You canceled the
previous
operation".
I ´d like to know how to solve this problem or another way to
synchronize
subforms with Acess 2007.
.
.