Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Recordset

Recordset

Scheduled Pinned Locked Moved Visual Basic
databasehelptutorialannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sweet Virgo
    wrote on last edited by
    #1

    hi friends i am woking on MS Access forms with MS Access Database. i want to add text boxes' data into table on click event of a buton. i am using buttons and want to use recordset object. i don't know how to open recordset and how to insert data in table from this button. i am using this code it gives syntax error ont insert statement but i have checked my statement is correct. ___________________________________ Option Compare Database Dim rst As ADODB.Recordset =========================== Private Sub cmdAdd_Click() Dim Did As Integer 'dim Dname as 'Set db = Humaintarian.mdb' 'Set rst = db.OpenRecordset("tbl_Dept") '.OpenRecordset("tbl_Dept") 'tbl_Dept is the table 'rst.AddNew txtDeptId.SetFocus 'We have to set focus for each field MsgBox ("txtDeptId=" & txtDeptId.Text) 'Just see what we got 'Did = txtDeptId.Text 'rst!Id = txtDeptId.Text txtDeptName.SetFocus 'We have to set focus for each field MsgBox ("txtDeptName=" & txtDeptName.Text) 'Just see what we got 'rst!Name = txtDeptId.Text txtDeptDescr.SetFocus MsgBox ("TxtDeptDescr=" & txtDeptDescr.Text) 'rst!Description = txtDeptDescr.Text 'rst.Update 'rst.Close INSERT INTO tbl_Sectors(Id,Name,Description) VALUES(txtDeptId.Text,txtDeptName.Text,txtDeptDescr.Text) End Sub __________________________________ friends plz help me i am stucked regards Farooq Azam

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups