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.
 
Back
Top