I have an access database Created - I am using Access 2007 and I have saved the database to 2003 as the users are on 2003
I have a main table in this Access database that I can maintain (Add/update/delete) records
I want now to be able to connect my access database to an SQL database – this SQL database is accessible through a user ID and password
In my access database we will call the table – tableACC
This has 5 fields
In my SQL database we will call the table – tableSQL
This table has 30 fields – I only want to take certain fields from this table
I want a create a form with a ‘Button’ which will invoke the VB code to do the following
I want to Select records from TableSQL that are Open (TableSQL.Open = yes) and Created between 2 dates (TableSQL,CreatedDate Between Date1 and Date2) – These dates must be entered by the user (these dates are parameters) And only select records that are not already on the tableACC.
For all the records that are selected I want to add these into the Access table TableACC.
I have not written VB code before – I would like to know how to write this code – how to be able to call the code from a ‘button’ - how to input the dates as parameters – how to open the SQL database with a user ID and password - how to read the SQL table – how to write to the Access table
Thanks very much for your help