update a subform (1 Viewer)

crowegreg

Registered User.
Local time
Yesterday, 20:32
Joined
Feb 28, 2011
Messages
108
I can't figure out how to get the subform requeried. With the attached DB, these are the instructions.
1. Open form frm_Menu_Reports_Variance
2. Select the command button Position Management Changes
3. For the Search Option, select Position ID
4. For the Position ID combo box, select any number
5. For the change type list box, select any item

After selecting the change type, you'll get the option to either view report or export report. Select view report.

When the subform is displayed, it will display the data from the previous selection, not the selection you have just made.

I've tried adding the following lines of code to cmdViewReport, but nothing worked.
me.frm_PM_Changes_subform_ID.Requery
Forms!frm_PM_Changes_subform_ID.Requery


Thanks for your assistance!!
 

Attachments

  • Database1.accdb
    512 KB · Views: 68
Last edited:

crowegreg

Registered User.
Local time
Yesterday, 20:32
Joined
Feb 28, 2011
Messages
108
I figured it out. Within the cmdViewReport, after CreateData, I needed these two lines of code.

Me.frm_PM_Changes_subform_ID.Form.RecordSource = strQry
Me.frm_PM_Changes_subform_ID.Form.Requery
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:32
Joined
Feb 19, 2002
Messages
43,565
Start by renaming the controls so they have meaningful names. No one wants to try to figure out what combo9 or list11 really are. Once you change the name property of these controls, you will orphan any associated code so find it and rename it and then fix all the references. ReplaceAll will work for this.

Once that is done, change the query so that it includes criteria that references the two controls so that it properly selects the data you want to see.
 

missinglinq

AWF VIP
Local time
Yesterday, 22:32
Joined
Jun 20, 2003
Messages
6,420
...Start by renaming the controls so they have meaningful names. No one wants to try to figure out what combo9 or list11 really are...
And in three months that No one will include yourself!

Linq ;0)>
 

Users who are viewing this thread

Top Bottom