Hi Marsh,
I have to say that this is driving me nuts. My environment was not too
stable. It kept crashing, sometimes just typing into the editor. Even the
help was locking up and could not be shut down unless everything else is
closed. Now it seems better - I have been closing all the windows that I am
not working on and have not been crashing. I'm running Windows 2003
Server - if you know of any issues relating to the os, please let me know.
I think that I have the latest service packs for Office. I am using Access
2003.
Now things are not jumping to the wrong code. By the way, it was jumping
correctly to the next event (which is not too surprising); it just was not
finishing the code in the function.
So, the bookmark is being set. I can watch it in the debugger and see that
Me.Bookmark(0) goes to Me.Bookmark(4), which is correct. This change is not
reflected in the UI. The first record still displays and I have to use the
arrows on the navigation bar to get to the correct record.
Is there a GoToBookmark() function that I have to call?
Could something be locking the Recordset so that only the navigation bar
works?
Thanks for your help.
David
Marshall Barton said:
David said:
I did have it in the Open event handler, but I have moved it to the Load
event handler and it still exibits the same behavior. If I look at the Me
and ds variables before the bookmark assignment, everything looks ok.
Me.Bookmark(0) = 0 and ds.Bookmark(0) = 4 (which is the record I selected).
It just jumps to the wrong location in the code after the assignment.
Assuming the JobNo field is a numeric type, I don't see
anything wrong. I guess I need more details.
Where/How is InitialJobNumber declared?
Where does it jump to?
Have you placed a breakpoint in the code and single stepped
through it to see what it does after the bookmark is set?
How about something in the Current event doing something
that causes trouble?
--
Marsh
MVP [MS Access]
David Rose wrote:
Here is the code I am using:
OpenArgs contain the job number.
On the line Me.Bookmark = ds.Bookmark execution jumps directly to the
Form_Load() event handler. The code initialJobNumber = "" is not executed
and no exception is thrown.
This is very strange. Any idea what could be happening?
On Error GoTo err_Handler
initialJobNumber = Forms!frmJobTracking.OpenArgs
Dim ds As DAO.Recordset
Set ds = Me.RecordsetClone
If ds.RecordCount > 0 Then
ds.FindFirst "[JobNo] = " & initialJobNumber
If Not ds.NoMatch Then
Me.Bookmark = ds.Bookmark
End If
End If
initialJobNumber = ""
Exit Sub
"Marshall Barton" wrote
It sounds like you have this code in the form's Open event.
The form's data (and RecordsetClone) is not available until
the load event.
David Rose wrote:
I have a form that displays all records with a certain clientID. Each
client has many jobs, each with a jobID. Initially the form
appears
with
the first job selected. There is a navigation bar at the bottom of the
form and I can move through the jobs using the navigation bar.
How do I programmatically move to a certain job, say with a jobID = 100?
"Marshall Barton" wrote
Here's a standard way using an unbound text box named
txtSearchID for the user entered ID.
With Me.RecordsetClone
If .RecordCount > 0 Then
.FindFirst "JobID = " & txtSearchID
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End If
End With