#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    3

    Delete data when the form closes


    I have a form which has a field that can contain sensitive data. I would like the field to revert to Null when I close the form so the next person to open it cannot see the name in the field.
    Your help as always is greatly appreciated
    Steve
  2. #2
  3. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Feb 2008
    Location
    Lake County, IL
    Posts
    865
    Rep Power
    152
    This is a bit confusing. You have data that is seen in a form but once you have seen it, you want to delete it? Is this data that is stored in your data base? if so, where? How would you get it at a later date if you needed it, if it was changed to null. Perhaps some more information on what you are doing that would help us to provide you with a usable response. Perhaps and example that explains the business operation of what you are doing.

    Comments on this post

    • MaleNurse agrees
    Alan Sidman
    Office 2010, 2007, 2002

    If I helped you, then click "give rep" button in the lower left corner.
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    3
    The information on the form is used to print a medicine label. Once th lable is printed it is no longer required. Subsequent patients may see the form and that woudl be a breach of confidentiality. So, once the label is printed the data in that feild "Patient" is no longer required and can be deleted. All we currently do is type over it or manually delete it. I thought it woudl be better to have the name delete once the form was closed.
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Set the event "On Exit"
    Use the Code Builder to open the vba (or vb.net depending on which version you are in)

    Then use Me!nameofthetextboxorwhatever = ""

    That will set the value of that textbox to ""

    Comments on this post

    • MaleNurse agrees
  8. #5
  9. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Apparently you can't edit your text on this forum?!?

    Anyway if you have a print button (or whatever button you are using to process) you can also use Me!nameofthetextboxorwhatever = "" in that code to delete it after you printed it or whatever you are doing with it

    Comments on this post

    • MaleNurse agrees
  10. #6
  11. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    3
    All that acheived was to delete the contents of the field when i exit that field. Id liek it to clear wne I close the form. I have tried pasting your suggestions into OnExit and it doesnt work
  12. #7
  13. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Originally Posted by MaleNurse
    All that acheived was to delete the contents of the field when i exit that field. Id liek it to clear wne I close the form. I have tried pasting your suggestions into OnExit and it doesnt work
    That is because you set it in the on exit of the text box, not the form... Change the property field in the drop down to the forum and add it to on exit
  14. #8
  15. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Should be put in

    Private Sub Form_Close()

Similar Threads

  1. Replies: 5
    Last Post: September 19th, 2012, 01:35 PM
  2. Replies: 3
    Last Post: July 24th, 2009, 04:01 AM
  3. Delete records from active form
    By JPR in forum Microsoft Access Help
    Replies: 1
    Last Post: February 12th, 2009, 01:53 PM
  4. making a form not add a record when it closes
    By jacosta00021 in forum Microsoft Access Help
    Replies: 2
    Last Post: July 8th, 2004, 06:07 PM
  5. HOW TO DELETE RECORDS FROM SQL WHEN USER CLOSES THE BROWSER WINDOW
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: February 14th, 2001, 09:22 AM

IMN logo majestic logo threadwatch logo seochat tools logo