Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2006

Tip: Looking for answers? Try searching our database.

Advise on 'How to do'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul B. - 28 Mar 2006 23:01 GMT
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....
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.