Results 1 to 3 of 3
  1. #1
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82

    SubForm not refreshing

    I have a subform, ctrYearlySubForm, that contains a combo box called yearcmb. This combo box is where the year is determined. I have another subform,CtrDemandJanuarysubForm, based on a query that uses the yearcmb as a criteria for the Year. In the criteria section I used, [Forms]![Main].[ctrYearlySubForm].[Form].[Yearcmb] and my main form is called Main. I also added [Forms]![Main].[Form]![CtrDemandJanuarysubForm].Requery to the VBA code for the Year sub form. Unfortunately, the CtrDemandJanuarysubForm does not refresh after changing the Yearcmb. I can only get it to work if I enter in something that doesnt exist in the criteria and manually enter in the year. Any suggestions will be greatly appreciated!

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Try this:

    Forms!Main!ctrYearlySubForm!Yearcmb.requery to requery the combobox values on the subform itself. (I would put this in the OnAfterUpdate event)

  3. #3
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    Unfortunately, I already had that, it seems to be requerying correctly but I must be referencing the combo boxes incorrectly. I have another combo box called Namescmb in the Main form and then the yearcmb as well. The namescmb grabs the full name of the feeder in STATICtble. NameId is the ID for the full name in STATICtble and is related to the Month-Year table, location where the information is, by Name2ID. The criteria i set for Name2ID is: [Forms]![Main]![Namescmb]=[Month-Year].[Name2ID] . I am wondering if I can use Name2ID even though it does not technically match up with Name2ID. Then the criteria for YearRecorded is: [Forms]![Main].[ctrYearlySubForm].[Form].[Yearcmb] .

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

Similar Threads

  1. Refreshing a subform?
    By Shag84 in forum Forms
    Replies: 4
    Last Post: 08-07-2011, 10:07 AM
  2. Replies: 4
    Last Post: 05-17-2011, 06:56 AM
  3. Link Tables Not Refreshing
    By goodguy in forum Import/Export Data
    Replies: 14
    Last Post: 01-04-2011, 12:49 PM
  4. Refreshing subform when form refreshed
    By Remster in forum Forms
    Replies: 27
    Last Post: 10-15-2010, 09:39 AM
  5. Refreshing comboboxes in a subform
    By KB_Dev in forum Programming
    Replies: 1
    Last Post: 04-07-2009, 12:12 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