Solved

SQL SYNTAX AND VBA

Posted on 2008-10-06
2
214 Views
Last Modified: 2013-12-25
I need to modify this piece of VBA code to do something a lot simpler. For the selected record, write to a new field I created STATUS = '1' that I created in the [Cient List] table.

Public Sub CloseFile(CNumber, Box, Reason As Variant)
    Dim SQL As String    
    'SQL = "INSERT INTO [Closed Files] (CaseNumber, FullName, Address, City, State, Zipcode, Telef_Home, Telef_Cell, Box, Reason)" & _
    '      "SELECT CaseNumber, (FullName, Address, City, State, Zipcode, Telef_Home, Telef_Cell, " & Box & ", '" & Reason & "'" & _
    '      "FROM [Clients List] " & _
    '      "WHERE [Clients List].CaseNumber = " & CNumber
    'DoCmd.RunSQL SQL
End Sub
0
Comment
Question by:gabepcsolutions
2 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 500 total points
ID: 22653136
SQL = "Update [Client List] Set Status=1 " & _
"WHERE [Clients List].CaseNumber = " & CNumber
0
 

Author Comment

by:gabepcsolutions
ID: 22653241
Thanks! ...a detail, was missing the  '1'
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now