hi

i have 3 basic queries in a database and i want to be able to run those when the database is opened. i have tried using VBA but get an error, this is what i have so far -
VB Code:
  1. Sub run()
  2.  
  3. DoCmd.RunSQL "INSERT INTO [currency] ( currencyName, euroRate )" & _
  4. "SELECT Template.Code, Template.[Rate vs EUR]" & _
  5. "FROM Template " & _
  6. "WHERE (((Template.Code) In ('GBP','USD','HKD')));"
  7.  
  8. DoCmd.RunSQL "INSERT INTO [currency] ([currencyName], [euroRate])" & _
  9. " VALUES ('EUR', '1.0000');"
  10.  
  11. DoCmd.RunSQL "SELECT currency.currencyName, currency.euroRate, (currency!euroRate/currency_1 !euroRate) AS dollarRate " & _
  12. "FROM [currency], [currency] AS currency_1 " & _
  13. "WHERE (((currency_1.currencyName)='USD'));"
  14.  
  15. End Sub

the first 2 queries run fine, but then i get an error stating that 'A RunSQL action require an argument consisting of an SQL statement'

any help much appreciated

jimmyp