Peter Bellamy
Registered User.
- Local time
- Today, 23:39
- Joined
- Dec 3, 2005
- Messages
- 295
Access 2k, DAO
I have some VBA code that works ok using a DoCmd.OpenQuery.
I thought rather than write lots of queries to complete this action on different tables it would be better to write it in SQL and just substitute the table and field names as required.
As I know little about SQL I took the SQL version of my query and used that as the starting point. But I cannot get it to work, can anyone help please!!
The SQL from the query I have used is:
strSQL = "SELECT [Andrews HWST].andrews_product_type, [Andrews HWST].andrews_product_type, Product.product_weight, [Andrews HWST].andrews_product_type, [Andrews HWST].andrews_serialno, [Andrews HWST].andrews_serialno, Product.product_lablecode INTO [Data lable data1]" & _
"FROM [Andrews HWST] LEFT JOIN Product ON [Andrews HWST].andrews_product_type = Product.product_name" & _
"WHERE ((([Andrews HWST].andrews_date_datalable) Is Null));"
Thanks
Peter
PS I am sure there is better way to post the code but I could see how to do it, sorry!
I have some VBA code that works ok using a DoCmd.OpenQuery.
I thought rather than write lots of queries to complete this action on different tables it would be better to write it in SQL and just substitute the table and field names as required.
As I know little about SQL I took the SQL version of my query and used that as the starting point. But I cannot get it to work, can anyone help please!!
The SQL from the query I have used is:
strSQL = "SELECT [Andrews HWST].andrews_product_type, [Andrews HWST].andrews_product_type, Product.product_weight, [Andrews HWST].andrews_product_type, [Andrews HWST].andrews_serialno, [Andrews HWST].andrews_serialno, Product.product_lablecode INTO [Data lable data1]" & _
"FROM [Andrews HWST] LEFT JOIN Product ON [Andrews HWST].andrews_product_type = Product.product_name" & _
"WHERE ((([Andrews HWST].andrews_date_datalable) Is Null));"
Thanks
Peter
PS I am sure there is better way to post the code but I could see how to do it, sorry!