Solved

Change the default value of a checkbox to its current value

Posted on 2004-10-13
8
352 Views
Last Modified: 2012-05-05
This is driving me up the wall... please somebody stop me reaching the ceiling!

All I want to do is save the value of a checkbox as its default value, so that if a user unticks it one time it will be unticked again the next time. Seems to me that I should be able to put

me!checkbox.defaultvalue=me!checkbox.value
docmd.save

but that's no good - the default value changes but then when the form reopens it's reverted back.

Please help me!
0
Comment
Question by:katerpillar
8 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 12296786
you need to savwe trhe definition when the form closes ...

DoCmd.Close acForm, "MyForm", acSaveYes

Steve
0
 

Author Comment

by:katerpillar
ID: 12296894
I'm already doing that.
0
 

Author Comment

by:katerpillar
ID: 12296956
I just tried changing it to acSavePrompt and it doesn't prompt me - clearly Access doesn't recognise that a change has been made.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 11

Accepted Solution

by:
BillPowell earned 140 total points
ID: 12296985
Just a thought.
Is your "Allow Design Changes" property set to "All Views" or "Design View Only". If it is the latter then that could be the culprit.

Bill
0
 

Author Comment

by:katerpillar
ID: 12297236
I'm running in Access 97 - is there an equivalent property? If not, then at least I understand the problem now - I can't change form properties in form view. Might have to rethink this one.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 12297319
Save the setting in a system table of yours or a custom property - then read this value and set the default value of the checkbox at the OnOpen event of the form.

/gustav
0
 
LVL 11

Expert Comment

by:BillPowell
ID: 12297650
Not sure about A97, but check in your properties in the Other tab.  Thats where it is in A2002.
0
 

Author Comment

by:katerpillar
ID: 12297813
Have decided to do it in database properties - thanks guys.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question