Setting Default Value

P

Paul Hammond

Why doesn't this work?

Private Sub chkZips_AfterUpdate()
Me.chkZips.DefaultValue = Me.chkZips.Value
DoCmd.Save acForm, "frmMain"
End Sub

I am designing this application for two different
groups. I would like the value in the check box to stick
so that the next time they open the form the value is the
same as the last time they ran it.

TIA

Paul Hammond
Richmond VA
 
R

Rick Brandt

Paul Hammond said:
Why doesn't this work?

Private Sub chkZips_AfterUpdate()
Me.chkZips.DefaultValue = Me.chkZips.Value
DoCmd.Save acForm, "frmMain"
End Sub

I am designing this application for two different
groups. I would like the value in the check box to stick
so that the next time they open the form the value is the
same as the last time they ran it.

A change like that will only "stick" if the form is in design view when you make
the change.

Store and retrieve it from a table instead.
 
D

Dale Fye

Paul,

You might want to try the following when you close the
form.

DoCmd.Close acForm, "frmName", acSaveYes

I think I recall that using acSaveYes when you close the
form will save it in its current status.
 

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

Similar Threads

On Lost Focus 2
saving default values 2
Swtchboard won't Open 2
Export Format Defaults 4
Default Value 6
combining fields 1
Default value last value entered? 3
Setting default value 3

Top