Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Bookmark in Access 1

Status
Not open for further replies.

ghost2

Programmer
Aug 7, 2003
145
US
Can anyone give me an example how to set a bookmark in a form in access? I have a recordset on a form that I need to requery but I do not want the record to move from that record. How can I accomplish this? Thanks all.
 
You could try the following two approaches, that'll give some exaples:

1 - Type bookmark in VBE, place the cursor within and press F1
2 - Use the combo wizard to create a combo, use the third alternative "find a record on my form..."

Both will give rather similar examples, using F1 also has some explanation.

If you're having some kind of problem, post the code, errormsg, what happens and what you want to happen.

- but you could also try using Me.Refresh in stead of requery (F1 offers more explanation).

Roy-Vidar
 
How are ya ghost2 . . . .

What your asking is called synchronizing. Example below:

Code:
Dim frm As Form, rst As DAO.Recordset, ID as Long

Set frm = Forms!YourFormName
ID=frm!YourPrimaryKeyName
frm.Requery
Set rst= frm.RecordsetClone

rst.FindFirst "YourPrimaryKeyName = " & ID
frm.Bookmark = rst.Bookmark

set rst=nothing
set frm=nothing


TheAceMan [wiggle]

 
Is there a way to update the recordset without having to complete a requery guys?
 
Did you happen to see my first reply, at the bottom...

Roy-Vidar
 
Oh sorry missed that. Would that not requery the grid though?
 
No, it'll refresh it. What do you mean by grid?

Refresh will show only changes made to the records in the forms current recordset. Records added or deleted "outside" this forms recordset (performed by others?) will not be shown.

Requery runs the query again, and will show chages to all records.

Requery causes first record in recordset to be displayed, Refresh "stays".

In a lot of cases, a refresh will do.

Another difference, a requery might be performed at control level (requering for instance the rowsource of combos and listboxes), whilst I believe the refresh operates on the forms (current) recordset.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top