Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating the presentation of an Excel workbook from Access

Status
Not open for further replies.

LeizladNeb

Technical User
Jan 27, 2003
7
0
0
GB
In the creation of a POS system, I am using both Excel and Access in it's development. I need to be able to open a particular Excel template file for data entry on clicking a button in Access. Is this at all possible?
I am using Execel as a Data Capture form using the Template Wizard to export data to Access. I want the two to appear as seamless as possible, but crossing over between the two, I have drawn a blank.

Also, I would like to dynamically add a record to a table and add the current date to the 'Date' entity in the new record.

Any help would be greatfully recieved as Im really struggling with this.
 
You can use the import spreadsheet function in order to import it, there are a couple of ways, the first is just to do a standard import, the more complex allows you to define the import template. You probably can just use the generic one.

-----
DoCmd.TransferSpreadsheet import, acSpreadsheetTypeExcel97, "Table Name", file Name, False
-----

In order to get the current day, you can use the date() function to return the current date.

----
todaysDate = Date
----

As far as adding a record, I am uncertain what you want to add other than the date so I hope this generic code helps.

----
sql = "INSERT INTO table VALUES ('" & todaysDate & "', " & variable2 & ")
DoCmd.RunSQL (sql)
-----
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top