locked
Combo Box is not working . When I select value from Combo box , It is not selected from Combo box RRS feed

  • Question

  • I have 3 table 1. Customer  2. InvoiceHeader 3. Invoice Detail 4. Product Master

    Foreign key relation is 

    Customer.CustomerID  -> InvoiceHeader.CustID

    Product.ProductID -> InvoiceDetail.ProductID

    InvoiceHeader.OrdderID -> InvoiceDetails.OrderID

    But When I create the combo box in a form for the selection of the customer , 'Find a record on my  a form based value selected in my combo box ' option is  not visible when I add the table Invoice Details in the form.

    If I had added only  the Customer , InvoiceHeader   table the option will show but when I add Invoice Details the option will disappear from there.

    Please can you let me know the reason. I am using office365

    Pol


    polachan

    Thursday, December 7, 2017 7:08 AM

All replies

  • I'm not sure I understand your problem. 

    What are you trying to do with the Combos? Are you trying to SEARCH for records in an existing set of records? Or are you trying to add/edit records by selecting values in those combos?

    If you're Searching for records, be sure that your combos are not Bound (i.e. that they have no ControlSource). 

    If you're Editing records, then of course you'd want them to be Bound.


    -- Scott McDaniel, Microsoft Access MVP

    Thursday, December 7, 2017 12:44 PM
  • ..............when I add the table Invoice Details in the form.
    You should not be including the  InvoiceDetails table in the form's query.  Instead a subform, in continuous forms or datasheet view, based on the table and liked to the parent form on OrderID should be included in the parent form.

    You'll find an example in InvoicePDF.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    Note that if you are using an earlier version of Access you might find that the colour of some form objects such as buttons shows incorrectly and you will need to  amend the form design accordingly.  

    If you have difficulty opening the link, copy the link (NB, not the link location) and paste it into your browser's address bar.

    The main invoice form in this little demo file includes an invoice details subform.  The parent form does not include any means for finding a specific customer, but if a copy of the current customer combo box were added to the form, but with an empty RecordSource property, then all that would be required would be to put the following code in its AfterUpdate event procedure:

         With Me.ActiveControl
            If Not IsNull(.Value) Then
                Me.Filter = "CustomerID = " & .Value
                Me.FilterOn = True
            Else
                Me.FilterOn = False
            End If
        End With

    Selecting a customer in the combo box would then filter the form to the selected customer's invoices.  Deleting any value in the unbound control to make it Null would show all customers' invoices.

    For illustrations of the use of unbound 'navigational' controls like this in various contexts, take a look at FindRecord.zip in the same OneDrive folder.


    Ken Sheridan, Stafford, England

    • Proposed as answer by Terry Xu - MSFT Wednesday, December 20, 2017 2:14 AM
    Thursday, December 7, 2017 6:38 PM
  • Hi polachan,

    Has your original issue been resolved? If it has, I would suggest you mark the helpful reply as answer or provide your solution and mark as answer to close this thread. If not, please feel free to let us know your current issue.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 20, 2017 2:14 AM