Results 1 to 2 of 2
  1. #1
    asela115 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2013
    Posts
    1

    Question access data from linked excell sheet in access

    Hi,

    need some advise on below

    I have a excel table (lets say the format is as follows)


    col1 col2
    dataset1 value1
    dataset2 value2

    (where col1 and col2 are the column names and dataset x and value x are the respective data values of each column)
    I have a access form and it has a combo box and a text box
    From Combo box I need to retrieve data available in col1 o excell
    once a particular dataset in col1 has been selected by Combo box the respective value in col2 should be displayed in text box in access form

    I was trying to create a linked table in excel to access ( I don't want to export data from excell to access since my excell sheet is getting changing time to time. so i don't need to change the access table every time)

    for combo box a simple query like below works to select the col1 values from sheet 1

    select col1 from Sheet1 (where Sheet1 is the linked table name in access)
    I wrote a code similar to below using DLookup to get respective values from col2 however it gives a error '#Name?

    =DLookup(col2,Sheet1,col1=[Forms]![FormName]![ComboBox Name])
    (here sheet 1 is the linked table name in access, I didnt give the absolute path of the excell file)

    this returns the above #Name?

    can someone help in this. this can be resolved by correcting my query or using another method (thats why I posted this in lengthy)

    Thanks

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    seems like an easy thing to do - unless I misunderstand your post;

    the form's record source should be the excel table link.....and with the fields there then you should see all the data via this form....

    when the form is in single view, rather than continuous view - - then in design mode you should be able to add a combobox into the header - and the wizard would step you thru set up to select a record based on it....

    hope this is helpful

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-28-2013, 02:41 PM
  2. Import excel sheet data into Ms-access using VBA macros
    By gokul1242 in forum Import/Export Data
    Replies: 2
    Last Post: 10-02-2012, 04:39 AM
  3. Split access querry in several excell sheet
    By wcedeno in forum Queries
    Replies: 3
    Last Post: 05-26-2011, 01:31 PM
  4. Access waits for Excell
    By e.badin in forum Programming
    Replies: 3
    Last Post: 01-10-2011, 07:51 AM
  5. opening an excell file from out of access
    By FSCHAMP in forum Access
    Replies: 1
    Last Post: 01-05-2011, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums