Change check box value in table

  • Thread starter Diego via AccessMonster.com
  • Start date
D

Diego via AccessMonster.com

Hi
i have i form linked to a table with these fields

Name Line1 Line2 ... LineN

Line1 .. LineN are check box with value = false at the beginning.
In the table there are obviously many records that means

Name1 False False .... False
Name 2 False False ... False
Name 3 False False .... False
.....
......
NameN False False .... False

What i want to do is to modify/fixed the value of check box at true value
(for example clik on a button) until the last record.
For example starting from the first records, for 5 records, change the value
of line1 to a true value, then, starting from records 6, change the value of
line2 to a true , then starting from records 13 change the value of line3 and
so on.

The results should be

Name1 True False ... False
Name 2 True False ... False
Name 3 False True ... False
Name 4 False True ... False
.....
......
NameN False False .... True


Any idea ?
thank you in advance
Diego
 
J

John W. Vinson

Hi
i have i form linked to a table with these fields

Name Line1 Line2 ... LineN

Line1 .. LineN are check box with value = false at the beginning.
In the table there are obviously many records that means

Name1 False False .... False
Name 2 False False ... False
Name 3 False False .... False
....
.....
NameN False False .... False

Your table design IS INCORRECT. To correctly model a many (names) to many
(lines) relationship, you should use *three* tables:

Names
TheName (don't use name as a fieldname, it's a reserved word)

(and if these are people's names use PersonID, LastName, FirstName, etc.)

Lines
LineNo <Primary Key, values 1-n>
<any information about the line>

LinesUsed
PersonID <or TheName if that's the primary key>
LineNo
What i want to do is to modify/fixed the value of check box at true value
(for example clik on a button) until the last record.
For example starting from the first records, for 5 records, change the value
of line1 to a true value, then, starting from records 6, change the value of
line2 to a true , then starting from records 13 change the value of line3 and
so on.

Are you treating this like a spreadsheet? Don't. An Access Table HAS NO ORDER
- there's no such thing as "the next five records". The records are just there
in a heap.
The results should be

Name1 True False ... False
Name 2 True False ... False
Name 3 False True ... False
Name 4 False True ... False
....
.....
NameN False False .... True

What real-life Entities to "Name" and "Line" represent? What - in the real
world - are you trying to accomplish? I'm sure there is a properly normalized
relational design to do it... but this *isn't* it.

John W. Vinson [MVP]
 
D

Diego via AccessMonster.com

Sorry
But the table is correct, infact until now i select by hand for every Name
the line (1...N) that i want.
This table is used to create atletic heats for kids (olimpic games in a
school). Until now all heats are created manually selecting for every name a
corrisponding line (heat). The selection was done with a form with all names
and a number of lines available (20). It works fine, but what i want to do is
to create heats automatically selecting for example the first 6 name the
line1, for the other 6 line2 ecc.
The final result is to have different heats (with 6 name). I want to create
different buttons to divide by 6, 8, 10 ecc.

Thank you in advance
Diego
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top