?
Solved

SQL SYNTAX AND VBA

Posted on 2008-10-06
2
Medium Priority
?
222 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 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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