Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008

    Unanswered: Combo from one table, to store result in another

    Hello... again
    This place is a wealth of information. Thanks to all

    Here I go again:
    I have a combobox_ClientName which updates a subform
    Each subform works great.. ie, guardian, medication, health.
    What I would like to do is have another combobox within a different subform that pulls the same ClientName (as above), but then stores it in another field in table encounters.

    I have managed to get this to work with an unbound combobox. The only problem is I cant figure out how to filter that. I only want it to show current clients..



  2. #2
    Join Date
    Dec 2004
    Madison, WI
    In the code bank (Page 7 or 8), there's some techniques I use. You may also want to look at all the different kinds of search forms posted as examples.

    Typically, I'll make a subform so that it has criteria in the recordsource (ie. under the ClientName field) as such: Like Forms!MyMainFormName!MySearchComboboxName & *

    Then, on the Main form in the AfterUpdate event of the MySearchComboboxName combobox, I'll simply add a: me.MySubformName.requery

    I'd highly recommend avoiding using any .Filter type commands. The .Filter doesn't work reliably from my experience.

    To store the ClientName (from an unbound combobox to the subform), use a command such as: Forms!MyMainFormName!MySubFormName!ClientName = Forms!MyMainFormName!MyUnboundComboboxName (note it's sometimes best to make a reference to the control directly versus me.mySubFormName.ClientName.value.)
    Last edited by pkstormy; 02-04-10 at 08:10.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts