I have a form with several text boxes and contain text only. Each row of text
boxes is enabled or disabled depending on the related Yes/No check box.
What I want to do is this....
If the user un-checks the y/n box, then (after confirming they want to do
this) delete all the text contained within those text boxes, so that when the
record is saved, any text boxes that had text in them, will now be saved
without any text.
I have the code working for the prompt to do this, and for deleting the text
in the boxes, but when I click save, then data is not deleted.
Thanks in advance....
tina - 29 Mar 2006 02:27 GMT
assuming that the textboxes in question are bound to fields in the form's
RecordSource, try the following code in the checkbox's Click event procedure
(or in the AfterUpdate event procedure), as
If Me!CheckboxName = False Then
If MsgBox("Do you want to delete this data?, _
vbYesNo) = vbYes Then
Me!FirstTextboxName = Null
Me!SecondTextboxName = Null
Me!ThirdTextboxName = Null
End If
End If
substitute the correct names of the controls, of course.
hth
> I have a form with several text boxes and contain text only. Each row of text
> boxes is enabled or disabled depending on the related Yes/No check box.
[quoted text clipped - 10 lines]
>
> Thanks in advance....
Paul B. - 29 Mar 2006 18:16 GMT
Thanks Tina,
Somedays I think I left my brain in bed....
Cheers
> assuming that the textboxes in question are bound to fields in the form's
> RecordSource, try the following code in the checkbox's Click event procedure
[quoted text clipped - 30 lines]
> >
> > Thanks in advance....
tina - 29 Mar 2006 22:19 GMT
you're welcome :)
> Thanks Tina,
>
[quoted text clipped - 36 lines]
> > >
> > > Thanks in advance....