Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    112

    Unanswered: convert an SQL statement in to vba

    I have wrote an update query with a table called 'wip1' updating 2 other tables called 'Jkt Schedule 1' and 'work in progress'. Intead of using the query i want vba to do the work. I have attached the SQL view of the update query as follows :
    UPDATE wip1 LEFT JOIN ([Jkt Schedule 1] LEFT JOIN [work in progress] ON [Jkt Schedule 1].[Mill Order No] = [work in progress].[Mill Order No]) ON wip1.ORDER = [Jkt Schedule 1].[Mill Order No] SET [Jkt Schedule 1].[Mill Order No] = [wip1]![ORDER], [Jkt Schedule 1].[Part/Colourway] = [wip1]![WIPPTN], [Jkt Schedule 1].[Design Desc] = [wip1]![DESCRIPTION], [Jkt Schedule 1].Cloth = [wip1]![CLOTH], [Jkt Schedule 1].[Quant Order] = [wip1]![WIPQTY], [Jkt Schedule 1].Machine = [wip1]![MACHINE], [Jkt Schedule 1].[Anticipated Due Date] = [wip1]![DATE DUE], [Jkt Schedule 1].[Design No] = [wip1]![Design No], [Jkt Schedule 1].[Jkt Info] = [wip1]![REF], [Jkt Schedule 1].[Cust Acc No] = [wip1]![Acc No], [Jkt Schedule 1].[Cust Order No] = [wip1]![cust ord], [work in progress].[Mill Order No] = [wip1]![ORDER], [work in progress].[Part/Colourway] = [wip1]![WIPPTN], [Jkt Schedule 1].REWORK = [wip1]![REWORK];

    How/what vba code would make this run in vb ??

    Please Help!

  2. #2
    Join Date
    Sep 2004
    Posts
    112
    Ive sussed it. Thanks anyway- i placed the command 'DoCmd RunSql' before the sql code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •