Results 1 to 4 of 4

Thread: URGENT: Help Required!

  1. #1
    Ive got 10/40w for blood... THCi's Avatar
    Join Date
    Jul 2003
    Location
    Somewhere, sometime, dunno why though.
    Posts
    512
    Thanks
    0
    Thanked
    0 times in 0 posts

    URGENT: Help Required!

    Right, my VB project has gotta be in in the morning, and Im having some trouble with a recordset, adding a new record to be precise.

    Im trying to use this code:
    Code:
    Private Sub cmdAddResToDb_Click()
    
    '' Add new record to set
    Data1.Recordset.AddNew
    
    
    '' Split TxtOut into an array
    s = Split(txtOut.Text, "|")
    
    '' Put Data into Fields
    Text2.Text = Dir1.Path
    Text1.Text = s(1) ''FileName
    Text3.Text = s(1) ''Path
    
    '' Update set
    Data1.Recordset.edit
    
    End Sub
    I cant add a new record to a recordset, all it keeps doing is editing the current one. Nothing else in the form using the recordset, also the recordset is being generated from a Data control hidden in the form. Could that have a part to do with this error?

    Thanks for any help,

    Nath'

  2. #2
    HEXUS.Metal Knoxville's Avatar
    Join Date
    Jul 2003
    Location
    Down In A Hole
    Posts
    9,388
    Thanks
    484
    Thanked
    442 times in 255 posts
    • Knoxville's system
      • Motherboard:
      • Intel X58
      • CPU:
      • Intel i7 920
      • Memory:
      • 2GB DDR3
      • Storage:
      • 1TB
      • Graphics card(s):
      • ATi HD3450
      • PSU:
      • Generic
      • Case:
      • Cheap and nasty
      • Operating System:
      • Vista 64
      • Monitor(s):
      • 24" LG LCD
      • Internet:
      • Virgin Media 20mb
    I've not actually done this as im planning to resit next year but the code i've been using to help the first years all morning is -

    Private Sub cmdadd_Click()
    Data1.Recordset.AddNew
    Text1.Text.SetFocus
    End Sub

    It doesn't deal with arrays, because i can't remember how to deal with em when adding a new record. Can't be of anymore help atm man as im knackered and about to retire to bed.

  3. #3
    Ive got 10/40w for blood... THCi's Avatar
    Join Date
    Jul 2003
    Location
    Somewhere, sometime, dunno why though.
    Posts
    512
    Thanks
    0
    Thanked
    0 times in 0 posts
    its ok dude, retire at will!

  4. #4
    Ive got 10/40w for blood... THCi's Avatar
    Join Date
    Jul 2003
    Location
    Somewhere, sometime, dunno why though.
    Posts
    512
    Thanks
    0
    Thanked
    0 times in 0 posts
    Nm folks, got it licked now...

    Feel like a right dumbass now as well

    All that was required was Data1.Recordset.edit to be changed to .Update!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. XP USB Problems - urgent as mouseless :(
    By Bruno in forum Software
    Replies: 3
    Last Post: 19-10-2003, 04:15 AM
  2. Hard Drive Help- Urgent
    By quarryman in forum PC Hardware and Components
    Replies: 2
    Last Post: 18-10-2003, 12:34 AM
  3. URGENT help needed please guys!
    By steve threlfall in forum Software
    Replies: 9
    Last Post: 15-10-2003, 01:54 PM
  4. Question about NB cooling (pretty urgent!)
    By KPeh in forum PC Hardware and Components
    Replies: 15
    Last Post: 09-10-2003, 03:09 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
  •