Results 1 to 5 of 5
  1. #1
    ayupchap is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    107

    How to auto populate fields from another table within a related form?

    Hi there hope you can help

    I have made a very simple access database which allows the search of a customer (or seller as we call them) for a record store. This then generates a transaction which in turn allows you to list the items they are buying, this can be seen in the screenshot I supplied. I have two things I would like to achieve firstly within the Record sales transaction object how can I get the details to auto-populate when the stock ID is entered (which is the key field)?



    Secondly if you look at the customer details for sales form how do I make that not in a grid view and just a single area like the customer_id and names above it or at least make it look more like that?


    Sorry not the best at Access and this is early design days but it is coming together and working and help with this would be amazing.


    Click image for larger version. 

Name:	Screen Shot 2016-03-31 at 3.47.34 PM.png 
Views:	17 
Size:	40.5 KB 
ID:	24194

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    part1
    If Me.RecordNew then
    me.fieldyouwishtofillinitially = fill with information you want.
    end if

    part2
    set the style of the window display from Datasheet to Form View. to get it out of datasheet. you may be able to right click on the subform and switch it to this. If you cannot, check the Formatting Tab for Allow Form View.

  3. #3
    ayupchap is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    107
    Thanks so much for the reply!!! I have to be honest though and say I am not sure where I type this in. The data is coming from the same record. Where do I complete part 1? Sorry to sound so neewbie but I've never done this before in Access.

  4. #4
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    for part1, you would want to put that in the Form_Current Event.

  5. #5
    ayupchap is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    107
    Hi there

    So I have managed to get the auto-populate to work - YAY! but now I am having other problems unfortunately.

    For example when I save a record it seems to be messing up another table and also when I add a new record it changes the previous one. Let me try to explain this.

    When I create a new record and add a new stock ID, it changes the record aboves stock ID to the same one which causes an error.
    Click image for larger version. 

Name:	Screen Shot 2016-04-04 at 10.03.02 AM.png 
Views:	13 
Size:	47.2 KB 
ID:	24217


    Click image for larger version. 

Name:	Screen Shot 2016-04-04 at 10.03.14 AM.png 
Views:	13 
Size:	14.3 KB 
ID:	24218

    Also this happens where it creates a new product record


    Click image for larger version. 

Name:	Screen Shot 2016-04-04 at 10.01.01 AM.png 
Views:	13 
Size:	43.0 KB 
ID:	24219

    I am not sure what is going on or why this is happening, if anyone can help please let me know. I am happy to upload the actual access database as it has no private data in it yet.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-24-2014, 01:22 PM
  2. Replies: 1
    Last Post: 06-24-2014, 01:31 PM
  3. Replies: 11
    Last Post: 06-06-2014, 01:17 PM
  4. Replies: 3
    Last Post: 10-05-2009, 07:22 AM
  5. Auto populate fields on a form
    By ldarley in forum Forms
    Replies: 0
    Last Post: 08-14-2008, 09:39 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