Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    82

    Exclamation Unanswered: Small Request of Help

    Weirdly my txtboxes won't clear on load.

    The code is
    Private sub form_load()
    Text1.text = ""
    Text2.text = ""
    Text3.text = ""
    end sub

    Text1 is linked to a db the other nothing if i click the "link" to the frm they are clear but if i change text1 and save the db return to my previous form then back to the second the forms have text in them (the txt i entered into text1.text)

    The full code is:

    Private Sub cmdChange_Click()

    adoPass.Recordset.Fields("Text1") = text2.Text
    adoPass.Recordset.Update
    If text2.Text = text3.Text Then
    Me.Hide
    frm1.Show
    Else
    MsgBox "Sorry but your new password isn't the same as you confirmed one, please amend this", vbInformation, "Check Password!"
    End If
    End Sub
    ---------------------------------------------------------------------
    Private Sub Form_Load()
    text1.Text = ""
    text2.Text = ""
    text3.Text = ""
    End Sub

    To get the txtboxes to clear you must exit the program and restart


    Thanx in advance

  2. #2
    Join Date
    Oct 2004
    Posts
    2
    try using the form activate event

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    The form load event only runs ONCE when the form is loaded into memory. NOT when it regains focus. As the_Bat indicated, the form Activate event is triggered each time the form regains focus.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Aug 2004
    Posts
    82
    Thank you very much The_Bat and loquin I see what you mean thanks for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •