Solved

SQL SYNTAX AND VBA

Posted on 2008-10-06
2
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

691 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