A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Save record sequence number from form



 
 
Thread Tools Display Modes
  #1  
Old March 26th, 2010, 06:39 PM posted to microsoft.public.access.forms
Phillip
external usenet poster
 
Posts: 63
Default Save record sequence number from form

Hi,
I posted this earlier but it never appeared.
I have a continuous form that displays 4 fields from a table. The form also
has sort buttons which sorts the records in the form based on the sort
selected. My table also has a field called “sequence number”. Based on the
sort that is selected I would like to save the record sequence number for
each record based on the order that the records appear in the form. In
other words the record that appears first in the form would have a sequence
number of 1 stored for that record in the table, the second record would have
a sequence number of 2, etc.
Is this possible and if so can some help me with the code.
Thanks in advance,

  #2  
Old March 27th, 2010, 04:45 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Save record sequence number from form

On Fri, 26 Mar 2010 10:39:01 -0700, Phillip
wrote:

That is possible, even though I'm at a loss trying to understand why
you would want to do this. Yet here we go:
When the user clicks the Sort button, you first sort the data like you
are already doing, and then you additionally run some VBA code like
this:
dim l as long
if me.recordsetclone.recordcount 0 then
with me.recordsetclone
.MoveFirst
l = 1
while not .eof
.edit
![sequence number] = l
.update
l = l + 1
.MoveNext
wend
end with
end if

-Tom.


Hi,
I posted this earlier but it never appeared.
I have a continuous form that displays 4 fields from a table. The form also
has sort buttons which sorts the records in the form based on the sort
selected. My table also has a field called sequence number. Based on the
sort that is selected I would like to save the record sequence number for
each record based on the order that the records appear in the form. In
other words the record that appears first in the form would have a sequence
number of 1 stored for that record in the table, the second record would have
a sequence number of 2, etc.
Is this possible and if so can some help me with the code.
Thanks in advance,

  #3  
Old March 29th, 2010, 02:16 AM posted to microsoft.public.access.forms
Phillip
external usenet poster
 
Posts: 63
Default Save record sequence number from form

Hi Tom,
Thanks you that is just what I needed and it worked great.
Thanks again,


"Tom van Stiphout" wrote:

On Fri, 26 Mar 2010 10:39:01 -0700, Phillip
wrote:

That is possible, even though I'm at a loss trying to understand why
you would want to do this. Yet here we go:
When the user clicks the Sort button, you first sort the data like you
are already doing, and then you additionally run some VBA code like
this:
dim l as long
if me.recordsetclone.recordcount 0 then
with me.recordsetclone
.MoveFirst
l = 1
while not .eof
.edit
![sequence number] = l
.update
l = l + 1
.MoveNext
wend
end with
end if

-Tom.


Hi,
I posted this earlier but it never appeared.
I have a continuous form that displays 4 fields from a table. The form also
has sort buttons which sorts the records in the form based on the sort
selected. My table also has a field called “sequence number”. Based on the
sort that is selected I would like to save the record sequence number for
each record based on the order that the records appear in the form. In
other words the record that appears first in the form would have a sequence
number of 1 stored for that record in the table, the second record would have
a sequence number of 2, etc.
Is this possible and if so can some help me with the code.
Thanks in advance,

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.