Help Me!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cyberking
    New Member
    • Jan 2007
    • 84

    Help Me!!!

    Hi.

    I started learning VB 6 a few days ago. Now, I am trying to build a database application, similar to a telephone directory.
    It performs basic functions as displaying name,number and email id.
    i have three buttons on my form, Add, Save and Delete to add new entries or to delete existing ones.

    Wat is happening is that when I click the Add button, all the text boxes are blanked out.When I fill in new entries and try saving it, i am getting an error "Insufficie nt base table information for updating or refreshing.".sa me happens for Delete button too.

    My code for the Save and delete buttons are as shown below
    Please help me!!!
    thanks in advance

    Code:
    Private Sub cmdSave_Click()
       dtaPhone.Recordset.Update   ' Something here???
       dtaPhone.Refresh
       cmdAdd.Enabled = True
       cmdSave.Enabled = False
       cmdDelete.Enabled = True
       txtName.SetFocus
    End Sub
    
    Private Sub cmdDelete_Click()
       dtaPhone.Recordset.Delete         ' Something here???
       dtaPhone.Recordset.MoveNext
       If dtaPhone.Recordset.EOF = True Then
          dtaPhone.Refresh
          If dtaPhone.Recordset.BOF = True Then
             MsgBox "You must add a record.", vbOKOnly +
             vbInformation, "Empty file"
             Call cmdAdd_Click
          Else
             dtaPhone.Recordset.MoveFirst
          End If
       End If
       txtName.SetFocus
    End Sub
    Last edited by willakawill; Jan 30 '07, 02:12 PM. Reason: please use code tags
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Hi. Please post the details of the table you want to update

    Comment

    • cyberking
      New Member
      • Jan 2007
      • 84

      #3
      Hi!
      The database is a flat database with jus one table. It consists of three fields namely Name, Description and Phone.

      I jus want the changes i have to make in order to be able to make a new entry and delete the existing records.

      Please help.. Its urgent!

      thanks in advance..

      Regards
      CyberKing

      Comment

      Working...