lundi 24 avril 2017

VBA Access using Check Box to Grey and Empty Cell Value

We are trying to use a CheckBox to not only disable (Not Enable) but also to erase anything that may have been input into the field/cell. The code is as follows:

Private Sub Check2349_Click()

   In_Ded_Single = Empty    
   In_Ded_Single.Enabled = Not In_Ded_Single.Enabled

End Sub

I have set Empty to ClearContents, 0, Clear, Off, etc. Yet all these reverts back to 0. It seems that once a number is entered and the cell is pre-formatted to either a Currency or Percentage, then the resulting 'Empty' simply leaves a null which turns to 0 in a pre-formatted cell. Maybe I have to also turn off the formatting, then the null will stay empty? Please help, easy quick fix I'm sure, but I just started learning VBA early last week. Thanks!




Aucun commentaire:

Enregistrer un commentaire