Results 1 to 3 of 3
  1. #1
    Phred is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2009
    Posts
    246

    Refresh Form on open.

    Access 2007, Compiled, not split, single user, Normalized, intermediate skill level.

    Form 1: See LPV.JPG LPV=Lowest Price Vendor. When you click the button a series of queries run that take thousands of prices and process them so that the lowest price vendor is displayed for each food item. This writes the final data to Tbl_LPVCurrent. This works fine.

    Click image for larger version. 

Name:	LPVScreen.JPG 
Views:	4 
Size:	41.6 KB 
ID:	9869

    Form 2: See DailyInventory.JPG Daily Inventory Reads information from Tbl_LPV Current and displays it on the screen. This works fine. It is based on a select query that reads the LPVCurrent table.

    Click image for larger version. 

Name:	DailyInventory.JPG 
Views:	3 
Size:	60.4 KB 
ID:	9870

    If the end user clicks the button on the LPV screen, creates a new LPV, then clicks on the Daily Inventory Tab the screen it shows the items #Deleted see DailyInventoryDeleted.Jpg.

    Click image for larger version. 

Name:	DailyInventoryDeleted.JPG 
Views:	2 
Size:	73.0 KB 
ID:	9871



    I understand why it is doing this. If I click the f5 button to refresh, the screen refreshes and the correct data pops up. I understand this.

    I am trying to make the Daily Inventory screen refresh automatically when it is opened. I have tried code running from the LPV screen and have tried code in lots of different Events in the Daily Inventory screen such as:
    GotFocus me.refresh or me.requery, etc.

    OnCurrent
    OnLoad
    OnEntry
    OnOpen

    Private Sub Form_GotFocus()
    Me![CmbPickItem].SetFocus
    Me.Requery
    End Sub

    None work.

    But when I hit f5 it refreshes perfectly.
    Where should this be located?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Daily Inventory is a subform?

    The button is on LPV subform?

    I always give subform container control name different from the object it holds, like: ctrInventory

    Try code in the button Click event, like:

    Forms!MenuPro.ctrInventory.Requery

    or the tab control page Click event, like:

    Me.ctrInventory.Requery
    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
    Phred is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2009
    Posts
    246
    Thanks Again June7. I am slowly getting it.

    I will close this out.

    Phred

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

Similar Threads

  1. Replies: 1
    Last Post: 05-03-2012, 02:25 PM
  2. Access 2010 Refresh VS Refresh ALL
    By Snwboarder1982 in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:07 PM
  3. Form Code refresh on open
    By mseeker22 in forum Forms
    Replies: 2
    Last Post: 07-08-2011, 12:35 AM
  4. Refresh Form
    By tpcervelo in forum Forms
    Replies: 7
    Last Post: 02-07-2011, 08:03 AM
  5. refresh a form
    By RedGoneWILD in forum Forms
    Replies: 18
    Last Post: 09-03-2010, 08:31 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