Connecting Tech Pros Worldwide Forums | Help | Site Map

Saving Last TransactionID in another table

PMB
Guest
 
Posts: n/a
#1: Nov 12 '05
Thank you in advance for any and all assistance.

I'm trying to keep my numbers for transactions sequential. I clear my
monthly transactions each month and store them in a general transactions
table. My problem is, everytime I clear the table, it wants to start back at
Zero, which conflicts with records that are already created.

Is there a way to create a second table and store the value of the last
transaction and pull it into the transactions for the new month?

I've tried psuedo code of; (neither field is AutoNumber)

If IsNull(TransactionID) Then
TransactionID = DMax("tblNewNumber", "TransactionID")+1
Else
TransactionID = DMax("tblTransactionsNew", "TransactionID")+1
End If

But, it doesn't work all the time. HELP

Michael



PMB
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Saving Last TransactionID in another table


Also, how can I save the last transaction into the new table so that the
transactionID's are sequential?

Michael
"PMB" <pmbragg@megavision.com> wrote in message
news:oQbmb.808$jt6.18119@news.uswest.net...[color=blue]
> Thank you in advance for any and all assistance.
>
> I'm trying to keep my numbers for transactions sequential. I clear my
> monthly transactions each month and store them in a general transactions
> table. My problem is, everytime I clear the table, it wants to start back[/color]
at[color=blue]
> Zero, which conflicts with records that are already created.
>
> Is there a way to create a second table and store the value of the last
> transaction and pull it into the transactions for the new month?
>
> I've tried psuedo code of; (neither field is AutoNumber)
>
> If IsNull(TransactionID) Then
> TransactionID = DMax("tblNewNumber", "TransactionID")+1
> Else
> TransactionID = DMax("tblTransactionsNew", "TransactionID")+1
> End If
>
> But, it doesn't work all the time. HELP
>
> Michael
>
>[/color]


Closed Thread