trying to option group delete field data

  • Thread starter Thread starter scottyboyb
  • Start date Start date
S

scottyboyb

Greetings, another trip to the well. The following code works except for:
Me!grpHowPaid.Value = ""

Here is the code. It is in the after update and form current events. Can
someone please tell me what little secret I do not know about deleting values
in option groups?

Private Sub chkPaid_AfterUpdate()
If Me!chkPaid = False Then
Me!txtPaymentDate.Visible = False
Me!grpHowPaid.Visible = False
Me!txtPaymentDate.Value = ""
Me!grpHowPaid.Value = ""
Else
Me!txtPaymentDate.Visible = True
Me!grpHowPaid.Visible = True
End If
End Sub

Many thanks,
Scott
 
Set the values to Null, not to a zero-length string, e.g.:
Me!txtPaymentDate = Null

This would be a really bad idea in the form's Current event though (assuming
they are bound controls.) As soon as you visit any record, you would lose
the contents of these fields.
 
Back
Top