Results 1 to 4 of 4
  1. #1
    MikeWaring is offline Novice
    Windows 7 64bit Access 2002
    Join Date
    Dec 2010
    Posts
    28

    Unable to display record in subform until mouse is scrolled

    Hi, I've created a subform within a main form but I can't get it to display the retreived data until I scroll the mouse wheel back to the previous record then forwards to the record I'm entering.

    The set up is as follows:
    The main form "GOODS RETURN" is for data entry of our Goods Returns process details (Reason for return, return date etc).

    The subform is based on a Query that retrieves all the details of the original sale (Sales invoice number, customer name, product part number etc etc) from another table. The Subform is set to view in Single Form format.

    The field that links both sets of data is the "Sales Invoice Number".

    When a customer wishes to send an item back to us, I enter the original Sales Invoice Number into the first field of the "GGODS RETURN" main form. This then retrieves and displays all the details of the original sale, from that original Sales Record Number. We then complete the rest of the "GOODS RETURN" form and continue the process.

    However, the subform doesn't display its details until I scroll the mouse wheel backwards and then forwards. What I need is that when I've entered the Sales Invoice Number into the field on the "GOODS RETURN" main form and then tab to the next data entry field on that form, it displays the related details.

    I've tried using various actions in the "On Exit" property of the Sales Invoice Number field, including a macro to open then close the subform, requery the query that retrives the related details, repaint the subform, but none of these macro actions cause the subfrom to display immediately.


    Any help would be gratefully received - there must be a way of doing this without having to scroll to another record and then back to the one I'm trying to enter? I suspect it needs a refresh action or something of that nature.



    Thanks in advance

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Problem might be that Sales is not a child of GoodsReturned. Subform might not be best vehicle for displaying the invoice info. But really need better understanding of data structure. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As June7 suggests, the Sales Subform Record is not a Child of GoodsReturned Record; you've got the cart before the horse, as it were. You have to have a Main Form Record before creating a Subform Record.

    You need to reverse what you're doing, with the Sales Records being in the Main Form and the Returns Records in the Subform.

    In the Main Form, you can use a Wizard-generated Combobox to retrieve the appropriate Sales Record, then enter your Return Record data in the Subform.

    Linq ;0)>

  4. #4
    MikeWaring is offline Novice
    Windows 7 64bit Access 2002
    Join Date
    Dec 2010
    Posts
    28
    Hi Both, thanks for the replies. I've managed to fix it after stumbling araound a bit - I set the On Exit Event Procedure to refresh the form and hey presto as soon as the curor leaves that field, the related records appear in the sub form.

    Once again, thanks for your help.
    Regards,
    Mike

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

Similar Threads

  1. Mouse wheel changing record
    By ashu.doc in forum Forms
    Replies: 5
    Last Post: 07-11-2013, 06:49 PM
  2. Replies: 11
    Last Post: 09-17-2012, 02:23 PM
  3. Replies: 1
    Last Post: 09-27-2011, 08:55 PM
  4. Checkbox unable to display a tick
    By sabre1 in forum Access
    Replies: 0
    Last Post: 11-08-2010, 09:43 AM
  5. Finding Scrolled position in Access forms
    By RJosephNewton in forum Access
    Replies: 7
    Last Post: 03-25-2010, 03:54 PM

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