Results 1 to 7 of 7
  1. #1
    Notters is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    3

    Autofill Form Data

    Hello,

    This is my first post and I feel like a right noob ...the fact is I am newbie with MA. Ok here is the issue:

    I Have a database with 2 tables in it - Lookup_SKU and MTO Central Source.

    I have created a form called MTO Central Source, which will be the data entry point for the MTO Central Source table. In the form I have added a combo box which looks up the SKU Code from the Lookup_SKU table. The problem is that under the Combo box I have 3 fields which I want to auto populate from the SKU Code which is chosen in the combo box, e.g. Description, Family & Type (These are unbound text boxes). Also once these are auto-populated I want this data transfered to the MTO Central Source table when I save the record and move on to a new clear record.


    Clear as mud I guess. I do not use VBA very much so not sure were to go from here

    Any support and help would be much appreciated

    Many Thanks for your time on this issue.

  2. #2
    Notters is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    3
    Oh, I am using Access 2007

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    If the combobox has the required data in it's columns, then a textbox control can be populated with the data from one or more columns of the combobox using code in the combobox's After Update event which references the combobox's Column property. Something like:
    Me.[NameOfTextbox] = Me.[NameOfCombobox].Column(1)
    The number (1) is the number of the column that has the data required. Keep in mind that the column numbers start with 0. So first column is number 0, second is number 1 etc.

    Written by Pat Hartman http://www.access-programmers.co.uk/...d.php?t=225430
    Generally copying data from one table to another is unnecessary and poor practice. The only time you would ever do this is when you need to capture the data at a point in time. An example of this would be the unit price for an item in an order entry application. The order should contain the price of the item at the time the order was placed or filled.

    It is easy enough to simply show lookup data by using a query that joins to the lookup table.
    IMHO. This is good advice from Pat
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    I threw together a little test database so you can perform the tasks you are wanting. I put the explanations in the code as to what most everything is doing, but that is some sound advice from Pat via Bob. Unfortunately, I am an instance where I need to transfer some data from tracking purposes, so I feel your pain but had this code handy to share!
    Attached Files Attached Files

  5. #5
    Notters is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    3
    Hi,

    Bob, many thanks for your swift reply. I agree with the advice in most cases.

    TG_W, many thanks for the sample database and code

    There is goods news and bad news. The good news is that the autofill is now working. The bad news is that the data is not being transfered to the Table once I move onto a new record

    The question now is how do I get the data to tranfer to the Table, once the combo box SKU has been chosen and the data auto populated and saved and moved on to a new record

    Hope that makes sense.

    Many Thanks for your time on this.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Bind each of the controls to a field in the table.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    timbo is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2011
    Posts
    41
    Does this help at all? http://www.baldyweb.com/Autofill.htm

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

Similar Threads

  1. Subform - autofill data from main form
    By Kelly_D in forum Access
    Replies: 3
    Last Post: 03-20-2012, 11:36 AM
  2. Replies: 4
    Last Post: 12-22-2011, 03:04 AM
  3. Autofill data based on query
    By James Brazill in forum Queries
    Replies: 0
    Last Post: 07-14-2011, 12:41 AM
  4. Replies: 4
    Last Post: 01-05-2011, 07:56 AM
  5. Autofill with data from another form
    By jacrum in forum Forms
    Replies: 2
    Last Post: 08-11-2009, 11: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