By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,082 Members | 2,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,082 IT Pros & Developers. It's quick & easy.

Importing data from excel via command button on a form.

P: n/a
When importing excel from access I am fully aware that one can import
directly into a table. Can you get as specific via code or something
to import data from an excel sheet to a FORM (Not Table) through a
command button. For example: cell C5 on the selected excel spread
sheet = textbox2 in the current form.

This is for a service repair type database. The service technicians
work out in the field and currently create their service orders on an
excel spreadsheet which looks pretty for the customer but is not
nicely organized and table import friendly.

I would like for the user to be able to click on a command button and
import from the selected repair orders.

Is this even possible?

Thank you!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sl********@hotmail.com (Mr. Bungle) wrote in message news:<ab************************@posting.google.co m>...
When importing excel from access I am fully aware that one can import
directly into a table. Can you get as specific via code or something
to import data from an excel sheet to a FORM (Not Table) through a
command button. For example: cell C5 on the selected excel spread
sheet = textbox2 in the current form.
I think the best you can do is import the record and then go to it. A
form does not *hold* data, but just contains it. What I mean is that
a form cannot store data - only a table can.
This is for a service repair type database. The service technicians
work out in the field and currently create their service orders on an
excel spreadsheet which looks pretty for the customer but is not
nicely organized and table import friendly.

I would like for the user to be able to click on a command button and
import from the selected repair orders.

Is this even possible?

Thank you!


Import selected data? Umm... if you link to the spreadsheet and use
the spreadsheet (or a few of the columns) as the rowsource for a
multi-select listbox, maybe. then the user could select the records
he wants to import from the linked SS and import those... other than
that, I don't know how to do it...
Nov 12 '05 #2

P: n/a
You can "automate" Excel from Access.

The easiest way is to add a reference to Excel to your mdb.
Then you can do something like this:
(WARNING: AIR CODE!)
Dim XL as new Excel.Application
XL.Workbooks.Add "C:\Spreadsheets\MyData.xls"
Me.Textbox2=XL.ActiveWorksheet.Range("$C$5")

There are a bunch of gotchas in this approach, so if you're serious about
it, I'd suggest you find some training in Automation.

HTH
- Turtle

"Mr. Bungle" <sl********@hotmail.com> wrote in message
news:ab************************@posting.google.com ...
When importing excel from access I am fully aware that one can import
directly into a table. Can you get as specific via code or something
to import data from an excel sheet to a FORM (Not Table) through a
command button. For example: cell C5 on the selected excel spread
sheet = textbox2 in the current form.

This is for a service repair type database. The service technicians
work out in the field and currently create their service orders on an
excel spreadsheet which looks pretty for the customer but is not
nicely organized and table import friendly.

I would like for the user to be able to click on a command button and
import from the selected repair orders.

Is this even possible?

Thank you!

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.