Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

clearing textboxes

hi,

i'm using Vb 6.0. On my forms, i have used a 'data control' and an 'Add' button to add data to my database. When i run the software i'm developing, All the data contained in my database are displayed automatically into my textbox, only when i click on the 'Add' button that the textboxes are cleared to allow me to enter new data. What should i do so that when i run the project, the data in the database do not appear automatically in the textboxes? When i run the project, i want the textboxes to be already cleared and ready for me to enter data in the textboxes. What should i do, what code should i use and where should i put the code?

Thanks
[709 byte] By [deena2209] at [2007-11-11 9:58:56]
# 1 Re: clearing textboxes
Call the data controls recordsets AddNew method from the forms Load Event, like this:
Private Sub Form_Load()
Data1.Recordset.AddNew
End Sub
Ron Weller at 2007-11-11 17:23:30 >
# 2 Re: clearing textboxes
Also you may use this :

Private Sub Form_Load()
Data1 = ""
End Sub

if you use this datacontrol for "add' only you may put it in "data1_gotfocus" will be better ..
Amahdy at 2007-11-11 17:24:30 >