Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL SYNTAX AND VBA

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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. …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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

610 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