Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Delete data when the form closes

Results 1 to 8 of 8
Share This Thread →
  1. #1
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    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
    alansidman's Avatar
    alansidman is offline Contributing User
    Join Date
    Feb 2008
    Location
    Lake County, IL
    Posts
    864
    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.
    Alan Sidman
    Office 2010, 2007, 2002

    If I helped you, then click "give rep" button in the lower left corner.

  3. #3
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    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.

  4. #4
    numus is offline Registered User
    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 ""

  5. #5
    numus is offline Registered User
    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

  6. #6
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    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

  7. #7
    numus is offline Registered User
    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Quote Originally Posted by MaleNurse View Post
    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

  8. #8
    numus is offline Registered User
    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    Should be put in

    Private Sub Form_Close()

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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

ASP Free Advertisers and Affiliates