p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 (http://p2p.wrox.com/forumdisplay.php?f=329)
-   -   PLEASE HELP ASAP -Form- Subform/tabs Linking records (http://p2p.wrox.com/showthread.php?t=88419)

GuestVisit September 10th, 2012 07:56 PM

PLEASE HELP ASAP -Form- Subform/tabs Linking records
 
This is due for a presentation tomorrow and I am a beginner at this. I hope that I can explain this well and I thank you for your help in advance.

I have a 5 tabs on a form and I need to generate records on each of my tabs based on the information in a label on the form. for example:

form - x (represents the value in a combobox)

Subform (contains different information all based on x. How do I get the infromation in the tabs to return only the record that matches the varible represented by the textbox x )

Tab 1 x....abc (if x=x return fields a, b and c)
Tab 2 x....def "
Tab 3 x....ghi "
Tab 4 x....klm "
Tab 5 x....tuv (if x=x populate unbound label t, u & v with info from table y)

Ian Ryder September 10th, 2012 11:20 PM

Hi,

I am not studying the book so, my apologies, that I cannot direct you to any part of the book that might help you.

However, firstly you will need to change your label control to a textbox control so that you can get the events that you need to code later.

Secondly, what you need to do to get your subforms to work is to change the record source of each subform to a query. Within each query of the subforms you to need to set the selection criteria for one or more of your fields to Forms!<FormName>!<ControlName> replacing FormName and ControlName with the names of your own parent form and textbox control name.

Finally, you need to code one of the textbox events to ReQuery each of your subforms based on the current criteria that has been entered in the textbox using <SubFormName>.requery. It is typically the AfterUpdate event that is coded to requery the subforms but you may need to change this to accommodate what you are doing. i.e. using the OnChange event?

Hope this helps.

Kind regards,

Ian Ryder


All times are GMT -4. The time now is 07:21 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.