Results 1 to 5 of 5
  1. #1
    Mclaren is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164

    Insert into table

    I have the following code :



    Qst = "INSERT INTO tbl_Activation (ID, Status, PCname) " & _
    "VALUES (1,'Yes','test');"
    CurrentDb.Execute Qst
    this inserts text into my table just fine, however i would like for the code to insert text that is in a unbound text box on my form. in essence where the word "test" is, i would like to put the text in the text box, i just have no idea on how to reference the text in the text box. The text box is called "txtPcName"

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Qst = "INSERT INTO tbl_Activation (ID, Status, PCname) " & _
    "VALUES (1,'Yes','" & Me.txtPcName & "');"
    CurrentDb.Execute Qst

  3. #3
    Mclaren is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164
    Quote Originally Posted by RuralGuy View Post
    Qst = "INSERT INTO tbl_Activation (ID, Status, PCname) " & _
    "VALUES (1,'Yes','" & Me.txtPcName & "');"
    CurrentDb.Execute Qst
    yyeeeehaaawww. been battling for a while with this.

    thanks man, have a beer on me....

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad I could help. Are you ready to follow the link in my sig and mark this thread as Solved?

  5. #5
    Mclaren is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164
    my bad, thought i had...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. SQL Insert into
    By jamin14 in forum Programming
    Replies: 15
    Last Post: 04-01-2010, 12:35 AM
  2. Replies: 0
    Last Post: 02-24-2010, 12:56 AM
  3. help with insert
    By jamie in forum Access
    Replies: 1
    Last Post: 11-16-2009, 06:02 AM
  4. Replies: 6
    Last Post: 08-17-2009, 01:41 AM
  5. Insert Query output into a table
    By ammu_sridhar in forum Programming
    Replies: 1
    Last Post: 06-12-2009, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums