Adding a new record to a FORM

G

Guest

I have a FORM that has many checkboxes. Everytime a check a check box it
refreshes the FORM and adds all the checkboxes that are being checked into a
field. But, when I add a new record and check a checkbox, after I have
checked the checkbox it goes back to the first record. How can I add new
records and checking checkboxes without it always going back to the first
record.
 
G

Guest

I havent figured out how to stop it going to the first record. However when I
update a record I save the # then after update set focus on record # and use
docmd.findrecord record#.
 
J

John Vinson

I have a FORM that has many checkboxes. Everytime a check a check box it
refreshes the FORM and adds all the checkboxes that are being checked into a
field. But, when I add a new record and check a checkbox, after I have
checked the checkbox it goes back to the first record. How can I add new
records and checking checkboxes without it always going back to the first
record.

There's something very odd about this: this is NOT normal behavior.
What is the structure of your Table? Does it have a lot of yes/no
fields? If so your table structure may need normalization. Is it
jumping to the new record when you check the last checkbox in the
form's Tab Order? If so, try setting the Form's Cycle property to
"Same Record". And can you explain what you mean by "adding all the
checkboxes... into a field"? a single field should not contain
multiple values!

John W. Vinson[MVP]
 
G

Guest

The checkboxes in my FORM are from fields that are in a Table. These are
yes/no values because I am keeping track to see if something is missing or
not so that's why the checkboxes. There is another field on the table that is
on my FORM that tracks how many checkboxes are being checked, so it sums up
the total. Anyway, that works fine, but when I want to add a record and click
on a checkbox, the FORM jumps back to the begining. When i go to the last
record i see the new record that I just added with the checkboxed checked
which is fine, but I don't want to keep going to the last record to finish up
the data entry each time I want to add a new record.
 
J

John Vinson

The checkboxes in my FORM are from fields that are in a Table. These are
yes/no values because I am keeping track to see if something is missing or
not so that's why the checkboxes.

That sounds like bad design. If you ever need to add something else to
track, you'll need to revise your Table structure, all your Forms, all
your Queries. Might this not be better modeled as a many to many
relationship, with three tables?

YourTable
YourID Primary Key

ThingsToCheck
CheckpointNo Primary Key
Description

Checklist
YourID <link to YourTable>
CheckpointNo <link to ThingsToCheck>

You'ld just add records to Checklist as each item is checked, and use
an Unmatched query to identify those things that have not been
checked.
There is another field on the table that is
on my FORM that tracks how many checkboxes are being checked, so it sums up
the total.

This field should certainly NOT exist in your table, since it can be
calculated (by counting checkbox values, or a Totals query counting
records in Checklist if you revise the structure). It's redundant, and
the value in the field could be WRONG, since you have no way to ensure
that it changes when the checkboxes do.
Anyway, that works fine, but when I want to add a record and click
on a checkbox, the FORM jumps back to the begining. When i go to the last
record i see the new record that I just added with the checkboxed checked
which is fine, but I don't want to keep going to the last record to finish up
the data entry each time I want to add a new record.

I have NO idea how your form is structured or why it's doing this. Do
you have a form with a subform???

John W. Vinson[MVP]
 

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