PC Review


Reply
Thread Tools Rate Thread

Check and uncheck

 
 
=?Utf-8?B?UGlldHJv?=
Guest
Posts: n/a
 
      5th Nov 2006
I have an optionFrame that contains two check boxes,if i check one of them
and close the form,when i open the form again both of them are unchecked.

I there a way that,whenever i check one of these two check boxes they
remain to be checked even after closing the database ?

Regards
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      5th Nov 2006
Pietro wrote:
> I have an optionFrame that contains two check boxes,if i check one
> of them and close the form,when i open the form again both of them
> are unchecked.
>
> I there a way that,whenever i check one of these two check boxes they
> remain to be checked even after closing the database ?
>
> Regards


Changes to unbound controls have no place to be saved. If you want data to
persist then you should store it in a table.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
Graham Mandeno
Guest
Posts: n/a
 
      5th Nov 2006
Hi Pietro

If the option group is bound to a field in your form's record source, then
the checkbox corresponding to the stored value will be checked when you
display a given record.

It sounds like your option group is unbound, which means that it will show
the option group's default value when you open the form. If the default
value is null (looks like blank) then the option group will be set to Null
and both checkboxes will be grey and neither of them checked.

If you want the form to "remember" the last setting, then you must store it
somewhere. This could be in a file, or the registry, or a database
property, or most commonly in a table. For example, you could have a table
named "Settings" with a numeric field "SavedOption". The table should have
exactly one record (you can add other fields for other settings).

Then, set the default value of your option group to:
=DLookup("SavedOption", "Settings")

Finally, you need to save the option to the table whenever the user clicks
the other box, so add an AfterUpdate event procedure for your option group:

Private Sub YourOptionGroup_AfterUpdate()
Dim sSQL as string
sSQL = "Update Settings set SavedOption = " & YourOptionGroup
CurrentDb.Execute sSQL
End Sub

I hope this gives you the general idea :-)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Pietro" <(E-Mail Removed)> wrote in message
news:3A9E7953-9F2A-4982-84A9-(E-Mail Removed)...
> I have an optionFrame that contains two check boxes,if i check one of
> them
> and close the form,when i open the form again both of them are unchecked.
>
> I there a way that,whenever i check one of these two check boxes they
> remain to be checked even after closing the database ?
>
> Regards



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check or uncheck a check box based on a cell value RTKCPA Microsoft Excel Misc 1 3rd Feb 2010 03:11 PM
Can't check/uncheck check box field on subform. rc51wv Microsoft Access Form Coding 7 18th Sep 2009 07:45 PM
Spell check won't let me check spelling or grammer when I uncheck =?Utf-8?B?VG9yaQ==?= Microsoft Word Document Management 1 2nd Oct 2007 02:26 PM
How do I check/uncheck ten or odd Checkboxes by click on one check =?Utf-8?B?S2VuIFZv?= Microsoft Excel Misc 5 4th Jan 2006 11:10 PM
how 2 create check box upon check it copiy A to B, upon uncheck i. =?Utf-8?B?YXlvYg==?= Microsoft Access VBA Modules 3 24th Mar 2005 04:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 PM.