Jumat, 21 Oktober 2016

Re: [MS_AccessPros] BOM Drill Down Subform

 

Doyce-

What code do you have in the After Update event of the combo on the outer form?  I bet it's that code that moves the outer form to the selected part.  You need to be able to call that code from your double-click code in the subform.  You can do that by making the event procedure Public - then you can call it as a method of the outer form.  Like this:

Forms!frmBOMLU.cboPart_AfterUpdate

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 Oct 21, 2016, at 16:51, winberry.doyce@con-way.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hello Pros,

I need help on this one. I have a form that I want to use to drill down into a bill of material to look up parts. The parent form has a combo box that looks up a part from the part master table. There is a subform that shows the components of the part in the combo box. I want to be able to doubleclick on one of the components part numbers and have it move to the combo box on the parent form and display the components of that subassembly. The parent form is working fine. Whatever I select from the combo box, the components display. I put code in the doubleclick event of the components in the subform to update the combo box in the parent form and requery. However, when the form is requeried, it always displays the first record in the part master instead of the part in the combo box. What have I missed? Here is the code in the doubleclick event of the component n the subform:


'reset form to show components of part that is double clicked.
    Dim txtPart
    txtPart = Me.COMPRT_02
    Me.Parent!cboPart = txtPart
    Forms!frmBOMLU.cboPart.SetFocus
    Debug.Print Me.Parent!cboPart
    Me.Parent.Requery


Doyce 

__._,_.___

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 (2)

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