dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: clearing textboxes

  1. #1
    Join Date
    Nov 2006
    Posts
    13

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    Call the data controls recordsets AddNew method from the forms Load Event, like this:
    Code:
    Private Sub Form_Load()
      Data1.Recordset.AddNew
    End Sub

  3. #3
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    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 ..
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Similar Threads

  1. Replies: 0
    Last Post: 09-27-2006, 03:47 AM
  2. Textboxes won't update from Child Tables
    By robnjay in forum .NET
    Replies: 1
    Last Post: 01-27-2006, 10:30 AM
  3. Textboxes
    By Tom in forum .NET
    Replies: 1
    Last Post: 05-11-2002, 09:08 PM
  4. XSL and Textboxes
    By Greg Rothlander in forum XML
    Replies: 6
    Last Post: 07-26-2001, 03:26 PM
  5. XSL and Textboxes
    By Greg Rothlander in forum ASP.NET
    Replies: 0
    Last Post: 07-10-2001, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center