Checkboxes losing value on form re-load

G

gahagan

Hi,

I'm running XP Pro, Access 2003. Whenever I switch back from "Form
Edit" view to "Normal View", all the checkboxes return to a NULL value.
Because my code uses the chkbox values to build dynamic queries, it
haults code every time i re-open the form in "Normal View." I've tried
resetting all the checkboxes to their default value, in both the
form_open form_load events -- to no avail.

The only work-around I've found, which is completely unacceptable for a
time-sensitive project such as this, is saving, closing, and then
re-opening the form from scratch.

Are there any events, actions, property-settings, control
re-positionings, etc. which would render all checkboxes Null? There
must be something stupid I'm missing here.

TIA for any help/advice you can offer.

AG
 
K

Kevin K. Sullivan

Possible work-around:

Try creating a command button on the form. Put your
reset-to-checkboxes-default-values code in the Click event of the
command button. IIRC, Form_Open and Form_Load do not run when you
switch from design view to form view, since, arguably, the form is
already Open and Loaded.

It sounds like your checkboxes are not bound to fields on a record. Is
your form bound to a table or query? If these are all unbound, you are
not going to end up saving the data anywhere before shifting to design
mode. Have you considered creating a table that will hold a single
record that is equivalent to your default values?

HTH,

Kevin
 
G

gahagan

I did just that - the command button reset - but they still weren't
sticking after a command execution or two (lbo requeries, show/hides,
etc.). You're right: it's an unbound form. Good idea about storing the
values in a Table - very clever. I might just do that.

Thanks for your help, Kevin!
AG
 

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