Solved

Change the default value of a checkbox to its current value

Posted on 2004-10-13
8
339 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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 49

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

776 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