473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

making record current

MLH
Cut this little FN out-a-Access 97 HELP. It makes mention
of the new record being made the current record. Is it the
Update method responsible for that - or the Bookmark method?
Which one?

Function AddName(rstTemp As Recordset, _
strFirst As String, strLast As String)

' Adds a new record to a Recordset using the data passed
' by the calling procedure. The new record is then made
' the current record.
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
.Bookmark = .LastModified
End With

End Function
Nov 1 '07 #1
6 2911
MLH <CR**@NorthState.netwrote in
news:pv********************************@4ax.com:
Cut this little FN out-a-Access 97 HELP. It makes mention
of the new record being made the current record. Is it the
Update method responsible for that - or the Bookmark method?
Which one?

Function AddName(rstTemp As Recordset, _
strFirst As String, strLast As String)

' Adds a new record to a Recordset using the data passed
' by the calling procedure. The new record is then made
' the current record.
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
.Bookmark = .LastModified
End With

End Function
You should learn to read the Help files. That'll tell you that the
..bookmark is the one.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 1 '07 #2
"MLH" <CR**@NorthState.netwrote in message
news:pv********************************@4ax.com...
Cut this little FN out-a-Access 97 HELP. It makes mention
of the new record being made the current record. Is it the
Update method responsible for that - or the Bookmark method?
Which one?

Function AddName(rstTemp As Recordset, _
strFirst As String, strLast As String)

' Adds a new record to a Recordset using the data passed
' by the calling procedure. The new record is then made
' the current record.
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
.Bookmark = .LastModified
End With

End Function
Its the bookmark method. The update method updates the database with all
changes made since the AddNew method was called. LastModified means "the
record most recently updated", and setting the recordset's bookmark to that
value causes that record to be the "current" record.

Nov 1 '07 #3
On Nov 1, 4:25 pm, MLH <C...@NorthState.netwrote:
Cut this little FN out-a-Access 97 HELP. It makes mention
of the new record being made the current record. Is it the
Update method responsible for that - or the Bookmark method?
Which one?

Function AddName(rstTemp As Recordset, _
strFirst As String, strLast As String)

' Adds a new record to a Recordset using the data passed
' by the calling procedure. The new record is then made
' the current record.
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
.Bookmark = .LastModified
End With

End Function
The bookmark moves the record pointer to the newly created record.

Nov 1 '07 #4
MLH
I'll try the learning to read suggestion first - then I'll tackle the
HELP files. Thx for the reply.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 01 Nov 2007 21:15:56 GMT, Bob Quintal <rq******@sPAmpatico.ca>
wrote:
>MLH <CR**@NorthState.netwrote in
news:pv********************************@4ax.com :
>Cut this little FN out-a-Access 97 HELP. It makes mention
of the new record being made the current record. Is it the
Update method responsible for that - or the Bookmark method?
Which one?

Function AddName(rstTemp As Recordset, _
strFirst As String, strLast As String)

' Adds a new record to a Recordset using the data passed
' by the calling procedure. The new record is then made
' the current record.
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
.Bookmark = .LastModified
End With

End Function
You should learn to read the Help files. That'll tell you that the
.bookmark is the one.

--
Bob Quintal

PA is y I've altered my email address.
Nov 2 '07 #5
There is a bit of a quirk with DAO if you add a new record and then update
it, right after you execute the update you lose your record position. To
make this is about the worst flaw in DAO.

Just about everything else about the dao object model is quite fine to me.

So in summary if you find a record, and then update the record the record
pointer remains in place and stays as the current record.

However if you add a *NEW* record then right after the update you lose your
record position, And must use the bookmark to reposition The record point
back to the record we just updated.

I repeat, this only occurs when you've added a new record. For existing
records it's not a problem.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Nov 4 '07 #6
MLH
Interesting point. I must agree, I see no logic
in losing your place after Updating an AddNew.
Would-a-been better to have held the placemark
as a default behavior.
Nov 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
1
by: Tony | last post by:
I have a form in access that has 5 fields for a certain record: 1)Date mailed, 2)Date received, 3)Date completed 4)Foreign Content amount and 5)record number. If the foreign content (FC)is >15% of...
2
by: Tony | last post by:
Hello, I am having difficulty in getting the current record of the current form to show after pressing a command button that takes me to another form. The command button takes me to another...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: jodyblau | last post by:
I have a form that is in Continuous form. In each record there is a button next to the a date box. When the button is pushed, the calendar control is set to visible (rather than in a seperate pop...
1
by: 2D Rick | last post by:
Access2003 in XP If I open a form to a specific record and click on a command button with the following code I get a duplcate record: DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand...
19
by: Genalube | last post by:
I have an application that will produce a Word document based on five separate queries this has required that I create a ADODB connection: 'Create connection to current database Dim Conn As...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
1
by: Ste | last post by:
Hi, I would like to have current date automatically enter into a form that is based on a table, so that from report I can tell how many records I have entered for the day. If I use date() on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.