Consulting

Results 1 to 12 of 12

Thread: search subform record based on master record

  1. #1

    search subform record based on master record

    Hello

    I have a subform and i need to change record when i change master form record.... but when i change master form record, subform record doesnt change... i tried with filter option but useless... kingly guide...

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    You need to set the Master Child links of the forms to whatever field you use to relate the records.

  3. #3
    Dear, during navigation of master record, child form record changes. but during change of master record by combox box (master field), child records dont change...... this is my problem....

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    It shouldn't make any difference.
    I have a combo box search that changes the master form, but it always maintains the correct subform record.
    What is your combo doing?

  5. #5
    dear if u have combobox as unbound control, it works fine. but if u have bound combobox, it did not retrieve child records in subform

  6. #6
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Is the bound combo for entering data?

  7. #7
    no, it is bound column but if record already present , it retrieves data..

  8. #8
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    I am sorry, I can't see the point of the bound Combo, surely it is better to have the Subform working properly?
    How do you relate the data that is in the 2 forms, via the Key field of the Master table?

  9. #9

    subform reply

    There are a few ways to get the subform to follow the master form. The basic way is to inspect the properties of the main form and while in design view, choose the subform control and display the master/child properties. Set these to a common field and you should be done.&lt;br&gt;<br>
    &lt;br&gt;<br>
    However, you might also be using a control on the subform to link to the main form. if this is the case, I suggest you opt for the option above. But if you insist, you can attempt to reset the sourceobject of the subform using the on current event of the main form. Something like this: me.subform.sourceobject = "subformname"&lt;br&gt;<br>
    &lt;br&gt;<br>
    Another approach you might be using is for the subform to have a criteria of a system table. For instance, in the query view of the recordsource of the subform, you might be doing a 'dlookup("currentidfield","zstblInformation") in the criteria or simply linking fields in the query grid. If this is the case, then the main form's on current event needs to reestablish the correct value for the subform. Something like 'currentdb.execute "update zstblinformation set currentfield = " &amp;amp; me.id&lt;br&gt;<br>
    &lt;br&gt;<br>
    Let me know if I can help more&lt;br&gt;<br>
    &lt;br&gt;<br>
    Jack Jaeger&lt;br&gt;<br>

  10. #10
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    86
    Location

  11. #11
    Did you get the answer you needed?

    Jack

    https://www.datacontrolllc.com

  12. #12
    VBAX Regular
    Joined
    Oct 2020
    Location
    Berlin, Germany. Often vivst Ukraine for business
    Posts
    6
    Location
    Ueah, It will be good to know.

Posting Permissions

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