Need help beginning new project

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tom0
    New Member
    • Sep 2008
    • 1

    Need help beginning new project

    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.
    Code:
    Dim szLastName As String, szCrit As String
             
             szLastName = "*" & Nz(Me!LastName, "") & "*"
             szCrit = BuildCriteria("LastName", dbText, szLastName)
             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
    Last edited by NeoPa; Sep 22 '08, 11:17 PM. Reason: Please remember to use the [CODE] tags provided
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hello, Tom.

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

    Regards,
    Fish

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      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.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        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)

        Comment

        Working...