Wrox Programmer Forums
BOOK: Beginning Access 2003 VBA
This is the forum to discuss the Wrox book Beginning Access 2003 VBA by Denise M. Gosnell; ISBN: 9780764556593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access 2003 VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 18th, 2011, 01:22 PM
Registered User
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Docmd.RunSQL

I tried running the code below and it did not work. Can someone help?

Function SaveRecords()

Dim strSQL As String
Dim db As Database

Set db = CurrentDb()

'bind the data from the form to the table
strSQL = "INSERT INTO tblAuditTracker(Date,Datetime,Employer_Name, Case_Status, CO_SME_Name"
strSQL = strSQL & "Case_Number,Reason_Audit,Specific_Reason_Deni al, Reason_Denial,CO_SME_Recommendation,"
strSQL = strSQL & "Action_Taken_by_CO_SME, Analyst, Analyst_Recommendation,SOP_Followed,Comments)"
strSQL = strSQL & "VALUES ('Me.txtDate','Me.txtDatetime','Me.txtEmp','Me.txt Status','Me.comboSME'"
strSQL = strSQL & "'Me.comboCaseNum','Me.comboAuditReason','Me.Combo 131','Me.Combo133','Me.comboReview','Me.comboActio n',"
strSQL = strSQL & "'Me.comboAnalyst','Me.comboRecom','Me.check135',' Me.Text23');"

DoCmd.RunSQL strSQL

End Function

Similar Threads
Thread Thread Starter Forum Replies Last Post
Docmd.RunSql Jasonhwrd Access VBA 11 January 6th, 2011 01:02 AM
Docmd.RunSQL Armand elia BOOK: Access 2003 VBA Programmer's Reference 0 June 17th, 2009 03:47 PM
Docmd.runsql anne.burrows VB How-To 2 October 25th, 2006 08:21 AM
docmd.runsql "select RodMead Access VBA 2 July 31st, 2004 02:55 PM
Help with DoCmd.RunSQL command ricmar Access VBA 3 July 21st, 2004 03:32 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.