Importing data from excel via command button on a form.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. Bungle

    Importing data from excel via command button on a form.

    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!
  • Pieter Linden

    #2
    Re: Importing data from excel via command button on a form.

    slayer3600@hotm ail.com (Mr. Bungle) wrote in message news:<aba497b8. 0404062038.6d91 f6@posting.goog le.com>...[color=blue]
    > 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.[/color]

    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.
    [color=blue]
    > 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![/color]

    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...

    Comment

    • MacDermott

      #3
      Re: Importing data from excel via command button on a form.

      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.Applicati on
      XL.Workbooks.Ad d "C:\Spreadsheet s\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" <slayer3600@hot mail.com> wrote in message
      news:aba497b8.0 404062038.6d91f 6@posting.googl e.com...[color=blue]
      > 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![/color]


      Comment

      Working...