Results 1 to 9 of 9
  1. #1
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72

    DoCmd****nSQL

    Hey all,



    I'm trying to add values to a table using a form. On the net I've found multiple examples that use DoCmd****nSQL (strSQL)

    but when I type DoCmd****nSQL into VBA editor I get an error. What do I need to bring in so that access recognizes the command?

    Thanks in advanced!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    Without the *** please.

    http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx

    It is helpful and facilitates communication if you tell us what you are trying to do in some detail, preferably with some sample data and any error messages you are currently receiving.

  3. #3
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    Thanks for the quick reply orange!

    I know it seems weird... but on multiple posts online they had the *'s

    I want to do something similar to this post: http://www.dbforums.com/microsoft-ac...able-help.html

    Without the *'s it says sub or function not defined

    Maybe it's a Reference issue?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    How is the form related to the table? Is it a bound form?
    Please tell us more detail of what you are trying to do. Sample data etc.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Some forums like that one mask the actual code because it looks like a Russian web site. The command is

    DoCmd.RunSQL
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    Ohh gotcha... that makes so much more sense xD

    It works! Just one quick thing, after I run the code it prompts me that I am appending a table. I can use VBA to hit Yes right?

    The actual message is: You are about to append 1 Row(s) Once you hit Yes, you can't use the Undo Command to reverse changes. Are you sure you want to append selected rows?

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    Ooooo thanks again pbaldy! That article was perfect again haha

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Need help w/ docmd.openreport
    By jwill in forum Reports
    Replies: 3
    Last Post: 06-04-2012, 09:49 PM
  2. DoCmd. Question
    By Trojnfn in forum Access
    Replies: 4
    Last Post: 09-30-2011, 04:51 PM
  3. What actually happens at docmd.openform
    By Beorn in forum Programming
    Replies: 4
    Last Post: 01-05-2011, 02:19 PM
  4. my first DoCmd.RunSQL
    By broecher in forum Programming
    Replies: 4
    Last Post: 11-05-2010, 09:35 PM
  5. DoCmd.SendObject Help
    By bgreer5050 in forum Programming
    Replies: 0
    Last Post: 01-12-2007, 06:27 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
  •  
Other Forums: Microsoft Office Forums