Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms n Subforms n VBA 1

Status
Not open for further replies.

xlbo

MIS
Joined
Mar 26, 2002
Messages
15,080
Location
GB
Hello all,
1st posting in this forum as Access is not my numero uno application. I know extensive VBA for Excel but only limited for Access (the syntax confuses me) so please be kind.

Here is the setup:
I have a main form (called frmSite_Details) and a subform (called sfrmQueries)

I have a combobox on the main form called cbCust and a textbox also on the main form called tbOutlet (as well as various other textboxes and labels)
I have set up the main form so that when cbCust is changed, tbOutlet (and all the other textboxes) reflects this, using

Me.RecordsetClone.FindFirst "[Cust_Code] = '" & Me![cbCust] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark

(This was generated automatically by how I built cbCust)
what I would also like to happen is that when cbcust is changed, thye subform is filtered based on the contents of tbOutlet which is a common field to the main form and the sub form

Hope someone can help me out here
TIA Rgds
~Geoff~
 
Hi

When you say 'Common filed' to the sub form and main form, have you set the master/child linked properties of the subform control to reflect this? - doing this should cause the subform to refresh as you require - without VBA code Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Apologies for my ignorance but where do I find the Master / Child properties - have looked at the properties on teh textbox and the subform but can't find it.... is it somewhere in the setup ?? Rgds
~Geoff~
 
HI

Look at the properties of the subform control, by selecting it on the main form, OK? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Apologies - think I've got it
Needed to look at the properties of the subform ON the main form
Master Field Prop_Ref_No (Main Form)
Child Field OutletID (Subform)
Seems to work very nicely
Many thanks Rgds
~Geoff~
 
Hi XLBO,

Welcome to the Access forum :-)

You have helped me often in the past with Excel issues.
Hope you enjoy working with Access.


Take it easy.

Peter Remember- It's nice to be important,
but it's important to be nice :)
 
Thanx Peter - I do actually enjoy working with Access - I just don't get to do it that often and I get a bit confused when it comes to some of the syntax in VBA Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top