By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,873 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

Need help beginning new project

P: 1
Dear All,

I am fairly new to access tho I have a fair bit of experience with VBA in excel. I am wanting (amongst other things!) to design a form with a subform on it to show certain business enquiries. The subform to show all of the enquiries (not editable) in a continuous form view with the header field also having text boxes which filter the data (ie searching for Last Name etc). The rest of the form to show all the details (editable) of the enquiry selected in the subform.

I have managed to do the first subform which works on its own but will not filter when it is a subform of a main form. Or it will filter the whole "Main" form results but not filter the list of results on the subform.
Expand|Select|Wrap|Line Numbers
  1. Dim szLastName As String, szCrit As String
  2.  
  3.          szLastName = "*" & Nz(Me!LastName, "") & "*"
  4.          szCrit = BuildCriteria("LastName", dbText, szLastName)
  5.          DoCmd.ApplyFilter , szCrit
As I am learning as I go along here, I would mainly like some advice of the best ways of doing this, Im not looking for full coded solutions.

Thanks in advance,
Tom
Sep 21 '08 #1
Share this Question
Share on Google+
3 Replies


FishVal
Expert 2.5K+
P: 2,653
Hello, Tom.

Try to filter subform's form using its Filter and FilterOn properties.

Regards,
Fish
Sep 21 '08 #2

NeoPa
Expert Mod 15k+
P: 31,470
It is also possible (general even) to link a subform to the main form on a (or some) fields. That way, any filtering on the main form is passed on automatically to the subform.
Sep 22 '08 #3

nico5038
Expert 2.5K+
P: 3,072
To elaborate on Neopa's comment, just single dick the sub form and open the properties by pressing the properties button.
Under the Data tab you'll find two "linkage" properties, one for the "master" and one for the "Child".
Following The Wizzard these fields will be filled for you, but you can also set them manually.
This comes in handy when you want to link to an unbound form control, like a combo box.

Nic;o)
Sep 23 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.