Setting Default Value

  • Thread starter Thread starter Paul Hammond
  • Start date Start date
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
 
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.
 
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
I got an error #Name? 1
Export Format Defaults 4
Swtchboard won't Open 2
Can't set Default from Code 3
change all form properties with code 7
combining fields 1

Back
Top