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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|