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

RENUMBERING KEYS

This is an interesting one.....

I have a field on FORM!FORMDATA (no, I did not name this) called KEY.

There can be multiple KEYS per record (equates to FIELDS on a given
DOCUMENT).

The users want to Add a Key and manually assign the number, say 2.
They do this to retain the order in which fields will print on a
document.

If Keys 2 --- 10 already exist, then Old Key 2 becomes 3, Old Key 3
becomes 4, etc.

Adding a new key is triggered by a button click event. Can anyone
supply code to do this?

Thanks!
amy
===
Nov 13 '05 #1
3 1418
From your description, I don't even understand what you _have_, much less
know how to tell you how to change it. You describe the Form, but not the
underlying Table. You speak of one KEY field, but say there may be multiple
KEYs per record. Where are the other KEYs stored in the record (not, I hope,
as multiple values in the same field... that is a nightmare to try to use)?
The implication here is that you want to add Fields to a Record at
runtime -- which does not make sense. In a relational table, every record
has the same _definition_, but may have different values.

Larry Linson
Microsoft Access MVP

"amywolfie" <am*******@verizon.net> wrote in message
news:33**************************@posting.google.c om...
This is an interesting one.....

I have a field on FORM!FORMDATA (no, I did not name this) called KEY.

There can be multiple KEYS per record (equates to FIELDS on a given
DOCUMENT).

The users want to Add a Key and manually assign the number, say 2.
They do this to retain the order in which fields will print on a
document.

If Keys 2 --- 10 already exist, then Old Key 2 becomes 3, Old Key 3
becomes 4, etc.

Adding a new key is triggered by a button click event. Can anyone
supply code to do this?

Thanks!
amy
===

Nov 13 '05 #2
am*******@verizon.net (amywolfie) wrote in message news:<33**************************@posting.google. com>...
This is an interesting one.....

I have a field on FORM!FORMDATA (no, I did not name this) called KEY.

There can be multiple KEYS per record (equates to FIELDS on a given
DOCUMENT).

The users want to Add a Key and manually assign the number, say 2.
They do this to retain the order in which fields will print on a
document.

If Keys 2 --- 10 already exist, then Old Key 2 becomes 3, Old Key 3
becomes 4, etc.

Adding a new key is triggered by a button click event. Can anyone
supply code to do this?

Thanks!
amy
===


Open an updateable recordset of the keys in the order you want them
and then update them in code.

dim rs as dao.recordset

set rs = db.openrecordset("SELECT...",dbopenDynamic)
rs.movefirst
intCounter=intCounter+1
do
rs.edit
rs.fields("Key").Value=intCounter
intCounter=intCounter+1
rs.update
rs.movenext
loop until rs.eof

rs.close
set rs=nothing
set db=nothing

.... or something like that...
Nov 13 '05 #3
amywolfie wrote:
This is an interesting one.....

I have a field on FORM!FORMDATA (no, I did not name this) called KEY.

There can be multiple KEYS per record (equates to FIELDS on a given
DOCUMENT).

The users want to Add a Key and manually assign the number, say 2.
They do this to retain the order in which fields will print on a
document.

If Keys 2 --- 10 already exist, then Old Key 2 becomes 3, Old Key 3
becomes 4, etc.

Adding a new key is triggered by a button click event. Can anyone
supply code to do this?

Thanks!
amy
===


You might want to describe your problem again and provide a bit more
detail about the field Key.

Are you wanting to add a new field to the table? IOW, if you have 10
keys in the table, do you want to add another field to the table so you
now have 11?
Nov 13 '05 #4

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

Similar topics

31
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
0
by: OC | last post by:
Because of the requirements on a high-speed data entry form, I need to reliably trap certain keys (specifically the "/", "*", "-", and "+") keys on the 10-key pad and treat them as "Function keys"....
4
by: pixel | last post by:
hi i just discovered something strange when i use in ProcessCmdKey this construction switch(keyData) { case Keys.Left: {
2
by: Pekka | last post by:
Could somebody say why the piece of code below does not work? My purpose is to renumber keys in a SortedList (after removal of an item) so that the keys would always contain an unbroken sequence of...
0
by: Johnny | last post by:
I'm looking for an algorithm that will manage the line numbers within a grid. The user should be able to add rows, delete rows, and insert rows anywhere in the grid and the line numbers should be...
14
by: vatamane | last post by:
This has been bothering me for a while. Just want to find out if it just me or perhaps others have thought of this too: Why shouldn't the keyset of a dictionary be represented as a set instead of a...
11
by: John | last post by:
I am coding a radix sort in python and I think that Python's dictionary may be a choice for bucket. The only problem is that dictionary is a mapping without order. But I just found that if the...
2
by: Charles Law | last post by:
I'll kick myself when you tell me, but ... I have a user control on a form, and I want the user control to see the arrow keys when I press them. If I press just about any other key the control's...
0
by: Menlalen | last post by:
K E Y S , A L I C I A M P 3 D O W N L O A D *Fallin 2001* 'Keys, Alicia - Fallin' (http://tinyurl.com/4zg3sr) (3:30 4.82Mb 192kbps) 'Keys, Alicia - Fallin (ft BustaRhymes and Rampage)'...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.