troubleshooting Question

Access VBA code to retrieve data from SQL server

Avatar of MECR123
MECR123 asked on
DatabasesMicrosoft SQL ServerSQL
8 Comments1 Solution93 ViewsLast Modified:
Hi

I am trying to create a shipment database in Access. I wish to create an Access database that will  read a table from an SQL server based on a date and a courier name parameters and populate this data into an Access Table.

I will have an access form where the user will enter a date and courier name. They then will have a ‘button’ called ‘Get Data’. When they press this button I would like the Access system to go and retrieve the data from an SQL database passing the 2 parameters.  They will retrieve the fields (Shipment Date, Courier Name, sales order number and Shipped Qty).

The data should then be updated into a Access Table.  It should do a check to see does the record exist already in Access. (if the shipment date + Courier Name + sales order number already exist in the Access database then skip update into the Access database and move to next record).

What would be the Access Code that I will need to create the connection to SQL, Read the Data from SQL passing the parameters and then updating the records into the Access Table.

Regards
Mike
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros