borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Macro's in excel.. Help needed)Next Topic (Combobox in tables) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Data Control & Bookmarks (DAO)
Poster Message
SteveG
Level: Sage


Registered: 15-04-2002
Posts: 56

icon Data Control & Bookmarks (DAO)  Archived to Disk

I am working on a datbase project at college using a DAO data control to move through a recordset(Dynaset). I am required to return (after update) to the location I am at when I add or edit a record. I set the bookmark but this does not seem to register or more precisely it always seem to register at the first record. I assume that moving through the recordset with the data control is not changing the current record. Any help would be appreciated.

Many thanks.

23-05-2002 at 09:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Data Control & Bookmarks (DAO)  Archived to Disk

Is rs.AbsolutePosition able to return the info you need?

When you move through the recordset (ie: rs.MoveNext) the current record does change, likewise it does with the control.

23-05-2002 at 09:30 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
SteveG
Level: Sage


Registered: 15-04-2002
Posts: 56
icon Re: Re: Data Control & Bookmarks (DAO)  Archived to Disk

I have used this in the delete record part of the program but can't use it on the edit or add sections. The specification calls for the recordset to be refreshed after adding/editing records which then places the new record in it's sorted position in the database. This may move the position of the original record by one.

23-05-2002 at 09:44 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Data Control & Bookmarks (DAO)  Archived to Disk

Since I'm assuming that you have to show all the records, and just return to the one that was modified, some of my normal methods won't work.

Are you allowed to loop thru the data until you reach it?

.MoveFirst
Do until .Fields("Whatever") = ID
   .MoveNext
Loop

23-05-2002 at 10:11 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
SteveG
Level: Sage


Registered: 15-04-2002
Posts: 56
icon Re: Data Control & Bookmarks (DAO)  Archived to Disk

Many thanks for the help.

I have now solved the problem. The cause I believe being positioning the current record as the last record during the form load event (this was to obtain a record count). By positioning the current record back to the first record after obtaining the record count as if by magic bookmarks worked !

27-05-2002 at 09:30 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Data Control & Bookmarks (DAO)  Archived to Disk

At least it's working for you now.

Never thought that could have been a problem, but then I've never been able to use .Recordcount in any of my programs. Strange how that happened.

28-05-2002 at 01:37 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Data Control & Bookmarks (DAO)
Previous Topic (Macro's in excel.. Help needed)Next Topic (Combobox in tables) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder