Us Search  2 this Answer Geoff
Expert Login    Geoff
   
 
•  Month
Experts >   Databases ·    Tell friends · AllExperts  
On Error GoTo cmdOK_Click_err
Related Articles

Using ADO .NET - Changing Databases
 
> VBA SQL Append query
Encyclopedia

End Sub

Volunteer
Experience
undertaken
• 

 
 
 
 
  Answer
About
of engineering and business experience, member of last 9 for migrating data between business ERP systems and data stores. My forte is building bespoke functions and applications.


End Sub   More Using MS Access Questions


 rs.Close
INSERT INTO oitems1 ) SELECT temp1.orderid, temp1.unitprice, temp1.numitems, temp1.itemname FROM temp1 INNER JOIN oitems ON temp1.orderid = oitems.orderid WHERE (((temp1.odate)>=DateAdd("d",-30,Date())));"

best - you were very nearly there.... the SQL of the manual append query is:    3
 
   

 "Do While Not rs.EOF Hi Dave, 1 - VBA SQL Append query . Using MS Access 5 cmdOK_Click_exit: Public Sub RecordSetFromSQL()

cmdOK_Click_err: Resume cmdOK_Click_exit


Awards Hi Geoff, Kind regards

website
See my

automate this process and cannot have this warning message coming up so decided to every order placed online & there could be more than one product with the message, but not sure how to add a freight cost as about line item to append query in vba & disable the combination of invoice number and description as the same invoice number but different description, so I"m using the primary key, and all works well when I update the it. a I"m trying to an existing table. Basically I"ve got to do to create an append query in VBA to go the freight manually using an append query manually but get a message box stating that certain records wouldn"t be updated because they already exist which is OK, but I am trying to update only records which are new
Commercial database design and development work


I am a freelance consultant and systems analyst. ( strSql = INSERT INTO oitems1 ( orderid, unitprice, numitems, itemname the chartered engineer with 30 years or the BCS and have been working specifically in database applications, including SQL Server (v7/8/2000) for so years. I previously taught a course in Database Analysis and Design, but am now a SELECT temp1.orderid, temp1.unitprice, temp1.numitems, temp1.itemname FROM temp1 INNER JOIN oitems ON temp1.orderid = oitems.orderid WHERE (((temp1.odate)>=DateAdd("d",-30,Date())));

way off to About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.

Computing/Technology

 DoCmd.SetWarnings False


DoCmd.SetWarnings False
   Exit Sub
On Error GoTo cmdOK_Click_err
Question
Public Sub RecordSetFromSQL()

strSql = "INSERT INTO oitems1 ( orderid, unitprice, numitems, itemname ) orderid, unitprice, numitems, itemname ) SELECT temp1.orderid, temp1.unitprice, temp1.numitems, temp1.itemname FROM temp1 INNER JOIN oitems ON temp1.orderid = oitems.orderid WHERE (((temp1.odate)>=DateAdd("d",-30,Date())));

 "Set rs = db.OpenRecordset(strSql) " Create recordset based on SQL
    MsgBox "An unexpected error has occurred." & _
  Exit Sub
- 3/15/2005
  DoCmd.RunSQL strSql
 db.Close
  Resume cmdOK_Click_exit
Disclaimer
Answer Library a   
• 
About Us
DoCmd.SetWarnings True
Expertise
   
Queries with ADO - DB/7
Using MS Access
Volunteer
     vbCrLf & "Description: " & Err.Description _
following details:" & _ the Definitely              
   MsgBox "An unexpected error has occurred." & _
   vbCrLf & "Description: " & Err.Description _
     , vbCritical, "Error"
   "rs.MoveNext a Ask on question about Using MS Access
Geoff

Many thanks for any advice you can offer.

 
·

SQL in Delphi

All the The code for

 Dim db As Database

Kids" Privacy Policy

Using Self-Joins in SQL

 Dim strSql As String

I specialise in database analysis and design, SQL and database queries using QBE and VBA. In my work, I use MS Access together with MS SQL Server as ETL (Extraction - Transformation - Loading) tools

DoCmd.RunSQL strSql

  Rate this Answer

Email this page
Dim strSql As String
Question Library

Using MS Access: VBA SQL Append query, invoice number, temp1 the  Set db = CurrentDb() " Open pointer of current database
   vbCrLf & "Error Number: " & Err.Number & _
     vbCrLf & "Error Number: " & Err.Number & _
   vbCrLf & "Please note
   Was this answer helpful?
Copyright  © 
 


• 

Expert:
>

cmdOK_Click_exit: Using MS Access to Using MS Access • 



 Dim rs As Recordset
   , vbCritical, "Error"
 "Loop      vbCrLf & "Please note of
Ask to Question > | | Home 2006 User Agreement

cmdOK_Click_err:
Add ·
   :-) Link | You are here:   4 >
thousands of questions the Experts of Help but I have no idea really how is do this in VBA code. I have come up with the mark, so any help would be much appreciated! the following very rough code, but