+ Reply to Thread
Results 1 to 11 of 11

How can I populate a worksheet from an access database and update a

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    How can I populate a worksheet from an access database and update a

    Hello to all,

    I am hoping someone can help and/or lead me in the right direction. I have a vehicle database created with basic info (unit no, make, model, license, etc..) I have a created a query within the database that when asked for a specific unit number [enter unit number] the query returns the unit number and other relevant data from that record. I have an inspection worksheet that I want all the information generated in the query to populate the worksheet cells from the results of the queried data. Ideally I wanted to input a unit number on the worksheet and have it hit the query in the Access database or just query the database and return the needed info into the defined cells in the worksheet. For example I would put 701 in the unit number cell of the worksheet, then ask the worksheet to do something...... import data, query, ?? and would then get the unit number and populate the other cells on the worksheet with the model, make, year, license, etc...


    This is a two part question. The second task would be once the worksheet data was populated I would use the worksheet for the inspection which then after wanted to update a table within the same database. For example once the worksheet was populated with vehicle information in the previous step I would now use the worksheet to complete the inspection. I would then have the current inspection date, mileage, and inspection type information that I would want to add back into a PM Inspection table in Access. This table would continually be updated from the results of an inspection.

    I do not have a lot of experience in Access but conceptually know what I want to happen. Hoping somewhere here could me.

    Thanks
    Todaychris

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: How can I populate a worksheet from an access database and update a

    You could record a macro using the Data->Query import features and modify as required.

    Or use opendatabase

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How can I populate a worksheet from an access database and update a

    Not sure how to do that. Was thinking I needed to learn some VBA and first bring my data into another worksheet SheetX then compare my entry on Sheet1(A1) to data in column A of SheetX. The idea I was considering since I am limited in knowledge in the other area was hopefully I could understand how to create a macro that will compare a value I entered in Sheet1(A1) to the data in column(A)in SheetX. Once the correct data was found I would want the data in the next several cells to the right of it on SheetX copied to Sheet1(A2:A4).

    Hopefully my rambling makes sense.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: How can I populate a worksheet from an access database and update a

    Oh I understand what you want, but without a sample worksheet and database to work with, we could be here a long time trying to work it out.

    There are countless examples on the net about using a query to bring info into a spreadsheet. And because there are several ways to skin a cat, we need details.

  5. #5
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How can I populate a worksheet from an access database and update a

    Is there a way to share the sheet and database?

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: How can I populate a worksheet from an access database and update a

    Yes. When you post, scroll down and select Manage attachments. If you supply a sheet and a database, you can zip them and post one file.

  7. #7
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How can I populate a worksheet from an access database and update a

    The zip file includes the excel workbook and mdb database. I highlighted in blue the cells I wanted data from the database to populate. I planned to manually enter a vehicle no. in the merged cell B1 on the system sheet and use a macro to find the matching unit number in the database or worksheet table from the database and complete the remainder of the vehicle information in the highlighted cells.

    The main table lists all of the vehicles. The other two table I planned to populate them with data following my inpsections. I guess the uploading back to the database I will learn after this test is figured out. The plan there was once I completed the inspection the new mileage and date will update the tables with current PM inspection mileage and date. Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: How can I populate a worksheet from an access database and update a

    OK I've got the first part done, but I have a couple of questions.

    I would then have the current inspection date, mileage, and inspection type information that I would want to add back into a PM Inspection table in Access.
    1. I assume you mean MV_PMI table, yes? There are only two fields plus the vehicle number. Vehicle#, InspDate, InspMileage

    2. Where is this information on the sheet? You have Date, Mileage and Location, but they are all merged into rows from F:I. Should the merge only be F:H?

  9. #9
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How can I populate a worksheet from an access database and update a

    Hi David,

    The inspection date and mileage are what we will be entered on the form during the inspection process. The two tables MV_PMI and BusPMI are what I wanted to update. The BusPMI would update from the worksheet. The MV_PMI will be receiving input from another data source. Yes your right the date, mileage, and location should probably be only merged into F:H. Think that was just done for appearance.

  10. #10
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: How can I populate a worksheet from an access database and update a

    OK take a look at this.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-14-2012
    Location
    LA, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How can I populate a worksheet from an access database and update a

    Hi David,

    I got the project back. What can you explain on what I will need to know to run it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA/ADODB How to change/update value in access database
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 05:23 AM
  2. Populate listbox with records from Access database
    By chinaboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2012, 08:06 AM
  3. Populate Drop down box with Access database
    By just66horns in forum Access Tables & Databases
    Replies: 3
    Last Post: 05-11-2009, 02:00 PM
  4. Update Access database through changes in Excel worksheet
    By munkayboi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2007, 07:16 PM
  5. How to populate excel combo box with access database?
    By computerguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2006, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1