Sabtu, 17 Desember 2016

Re: [MS_AccessPros] Requery Combo in Subform

 

David-


AfterUpdate fires only if you change the value - not if the value changes just because you moved to a new record.  Do the Requery in the Current event of the outer form.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Dec 17, 2016, at 2:35 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Update on the update...
I apologize, but I spoke too soon.

My subform combo control now displays properly for the FIRST RECORD ONLY when the unbound combo is changed.  When I change records in the main form, the subform combo does not display.  The subform combo is filtering now on the PK ID field of the main forms records.  I have your requery statement in the AfterUpdate event on the PK ID text field.

Should the requery statement be in some other event instead?  


---In MS_Access_Professionals@yahoogroups.com, <david.pratt@...> wrote :

Update...
I gave up on filtering the subform based on the unbound combo in the main form, and instead filter it on a text field in the main form.  It now works fine and with the same requery statement you provided.

I would still like to know why the VBE stopped prompting me after the FORM argument in the REQUERY statement. (hoping I am using the correct terms for all this)


---In MS_Access_Professionals@yahoogroups.com, <david.pratt@...> wrote :

I must be doing something wrong.  I had tried that already, except for the ! after FORM.  i  had used the period instead.  I tried it just now with the exclamation point and still no joy.

The VBE autotype help works all the way up until I type in (or select) FORM.  The name of my subform's combo box will never come up in the VBE autotype.

And I checked several times.  My subform control and subform both have the same name.

When I replace the combo with a text box, the data is there.  I just can't get the combo to display.  any other thoughts about what I might be doing wrong?


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

David-

The form is:

Me.NameOfSUBFORMControl.Form!NameOfCombo.Requery

Note that it's not the name of the subform inside the control - that might be different from the name of the control.

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Dec 17, 2016, at 05:21, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I have a main form and subform.  In the main form I have an unbound combo in the header to filter the records of the main form.  In the subform I have a combo box which I am trying to filter based on a field in the main form. The subform combo box works fine the first time the main form is opened and filtered with the unbound combo.  However, when I change the value in the unbound main form combo, the combo in the subform doesn't work. 

I think the subform combo needs to be requeried when the main form unbound combo is changed.  I don't know how to do that, or if in fact that is my problem.  When I try to type in the subform name in the AfterUpdate event, it is not in the list of objects from which I can select.

Help please.





__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar