473,378 Members | 1,391 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,378 software developers and data experts.

How to either programatically reset AutoNumber or simulate autonumber in a temporary table

I use a temporary table to assemble unrelated data for specific forms and
reports. After each use of this table, I have a delete query which empties
the table out for its next use.

I have one field I want to populate with the record number as it appears in
the form. That way I can use a comparison with Me.CurrentRecord to change
the background color of the text boxes for the OnCurrent property. I'm
doing this because I want the record selector turned off. I don't like the
way it looks. I'd rather have the current row a different color. I got a
different idea for this in a different post yesterday and it looked
interesting, but I'm guessing there is another way that is closer the the
way I'm thinking.

AutoNumber doesn't reuse the sequential numbers, so either I'll need to
reset the field every time I use it, or, if this isn't possible, I would be
willing to make a numberical field and write some code to repopulate it
every time it is used. I'm not sure how that code would look.

Any thoughts on how to approach this? Maybe there is a completely different
idea out there that is better.

Thanks.

Rich Hollenbeck
Nov 13 '05 #1
2 2582
You might want to look at conditional formatting; this could solve the whole
thing without worrying about numbers.

After all, what's going to happen if a user resorts the records in the form?
"Richard Hollenbeck" <ri****************@verizon.net> wrote in message
news:RWUMd.9141$Dc.1542@trnddc06...
I use a temporary table to assemble unrelated data for specific forms and
reports. After each use of this table, I have a delete query which empties the table out for its next use.

I have one field I want to populate with the record number as it appears in the form. That way I can use a comparison with Me.CurrentRecord to change
the background color of the text boxes for the OnCurrent property. I'm
doing this because I want the record selector turned off. I don't like the way it looks. I'd rather have the current row a different color. I got a
different idea for this in a different post yesterday and it looked
interesting, but I'm guessing there is another way that is closer the the
way I'm thinking.

AutoNumber doesn't reuse the sequential numbers, so either I'll need to
reset the field every time I use it, or, if this isn't possible, I would be willing to make a numberical field and write some code to repopulate it
every time it is used. I'm not sure how that code would look.

Any thoughts on how to approach this? Maybe there is a completely different idea out there that is better.

Thanks.

Rich Hollenbeck

Nov 13 '05 #2
The way my application is set up, the end user will have neither the need,
nor the opportunity, to sort these records on this form. I did look at
conditional formatting, but didn't arrive at a decent expression to find out
if this is the current record. However, I did find a website with the
answer I'm seeking: http://www.mvps.org/access/forms/frm0047.htm. I'm
going there right now to see how this works. Thanks for your reply.

Rich Hollenbeck
"MacDermott" <ma********@nospam.com> wrote in message
news:Le****************@newsread3.news.atl.earthli nk.net...
You might want to look at conditional formatting; this could solve the whole thing without worrying about numbers.

After all, what's going to happen if a user resorts the records in the form?

"Richard Hollenbeck" <ri****************@verizon.net> wrote in message
news:RWUMd.9141$Dc.1542@trnddc06...
I use a temporary table to assemble unrelated data for specific forms and reports. After each use of this table, I have a delete query which

empties
the table out for its next use.

I have one field I want to populate with the record number as it appears

in
the form. That way I can use a comparison with Me.CurrentRecord to change the background color of the text boxes for the OnCurrent property. I'm
doing this because I want the record selector turned off. I don't like

the
way it looks. I'd rather have the current row a different color. I got a different idea for this in a different post yesterday and it looked
interesting, but I'm guessing there is another way that is closer the the way I'm thinking.

AutoNumber doesn't reuse the sequential numbers, so either I'll need to
reset the field every time I use it, or, if this isn't possible, I would

be
willing to make a numberical field and write some code to repopulate it
every time it is used. I'm not sure how that code would look.

Any thoughts on how to approach this? Maybe there is a completely

different
idea out there that is better.

Thanks.

Rich Hollenbeck


Nov 13 '05 #3

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

Similar topics

12
by: deko | last post by:
Is there a way to reset the AutoNumber sequence? I have several tables that use the AutoNumber field as the Primary Key, and I'd like to somehow do an Import/Export that will make remove the...
3
by: Cillies | last post by:
Hello, I was wondering if anyone knew how to reset an auto number. I.E. in my database I have two tables with autonumbers as primary keys. So I was wondering if anyone knew an easy way of...
2
by: N. Graves | last post by:
Hey is there a command like in SQL Transactional that will reset the Autonumber field to the highest number in the found in the field? I developing a access database with a several table that...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
4
by: Danny | last post by:
I have a db that has a table that is never deleted but just has records cleaned out "delete * from table" but each time it is populated, the autonumber is not reset to 0 and picks up where it...
3
by: trueblue7 | last post by:
I apologize if this question has been asked before... I'm trying to reset autonumber fields back to 1. The autonumber fields are part of the composite primary keys. I followed the MS help with...
2
by: junkaccount | last post by:
Hello, I currently have a field named QuoteNumber in a table named Quotes. The field is set as autonumber and is used to assign sequential numbers as users enter information in the table through...
2
by: Ofer | last post by:
Hi, We use the ASP.net loginControls and the DB schema. How to programmatically activate the "PasswordRecovery" of a specific end-user when a user clicks my web application's button? I need to...
2
mkremkow
by: mkremkow | last post by:
Access 2003 on XP Someone here at work deleted a record (&$%^&*&!!!) and screwed up the Autonumber "Job ID" field . I need to reset the Autonumber field back to it's original numbers and still...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.