Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help please

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi. I have a form in which you can ADD RECORD. Now, i have a textbox called TEXT1. I want to create a CLEAR button that will let me clear the TEXT1 box when i click on it. So for example, I can enter a string into TEXT1, but when i click on the clear button, it'll make TEXT1 a blank box. How do i do that and what is the code for that? Thanks in advance
 
Try the following, I thinks it's what you're looking for.

Private Sub Command1_Click()

' Access requires the control to have focus to set a property
Text1.SetFocus
' Set the text box = to nothing
Text1.Text = ""
' May want to set focus back to some other control here

End Sub
 
This also works!!
Private Sub cmdClearText1_Click()
' Clear ctrl Text1
Me.Text1 = Null
End Sub




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top