• Filter Forms in Access (97 SR2)

    • This topic has 9 replies, 4 voices, and was last updated 22 years ago.
    Author
    Topic
    #388578

    I am using an Access front end on a SQL database. I have created a filtered form and wish to open a new tabbed list form based on the criteria of the original form, does anyone know how to do this?

    Viewing 1 reply thread
    Author
    Replies
    • #682821

      Could you take the original forms Filter setting and in whichever event you’re using, set the Filter property of the new form question

      • #682822

        I don’t think I explained it very well!! What I want to do is use the original form filter as the default value in a field on the new form, if that makes any sense. For example the original form showed an organisation, by clicking on a button you can view a list of all budgets for that department, in the new form if I was to enter a new budget I don’t want to have to enter the organisations ID, I’d like that as a default value. I’m new to VB and struggling, if you can help I’d really appreciate it.

    • #682823

      Yes, I think so, but we are going to need more details to help you. By a filtered form, I presume you are refering to a form that displays one record from a set of data records, but I don’t understand what you mean by “tabbed list form.” In general you use a command button to do this sort of thing, and you use a WHERE condition to open the second form, but the devil is in the details. It would also help to know what your level of experience with VBA and Access is.

      I see you answered some of the questions I had while I was typing grin

      • #682826

        Can you let me know what additional details you could do with? Basically I’m a SQL developer but am needing to use Access as a front end and it’s the first time I’ve really had to use VB with Access.

        • #682827

          Your answer to Steve filled in some of the gaps, but I’m still not sure what a tabbed list form looks like.

          We often use combo boxes to display a set of choices a user can make – list boxes are another option though they are more complicated, especially when you make them multi-select. In general for those type of controls, we set a value on the new form based on the current record being displayed in the original form, and we use a SQL statement that refers to the value of the control as the row source for the combo or list box.

          • #682828

            I used a tabbed list form, to describe a form showing a filtered list of data, as opposed to a form that only shows data relating to one record.

            In the original form I used a combo box to select the record I want, what code do I use in the 2nd form to get the data held in the combo box in the first form and use it as a default value?

            • #682830

              There are example databases with various user interface tips and tricks on Microsoft’s site at
              http://www.microsoft.com/AccessDev/Articles/solover.htm%5B/url%5D

            • #682862

              Are you speaking VB? Access forms and controls are a bit different, so we aren’t being dense, we’re just tyring to get our heads around the description so we can figure out how to help. If you want to use the value from the combobox in the first form to filter the data in the second and you use the DoCmd.OpenForm statement to open the second form, you can pass in a WhereCondition that will open the second form with only the specified records (assuming the second form is bound to a data source). If the second form is unbound or you need to extract the combobox value after the fact, you can refer to it in code or in a controlsource using the syntax Forms!FormName!ComboboxName.

            • #682869

              Thank you, that does exactly what I want.

    Viewing 1 reply thread
    Reply To: Filter Forms in Access (97 SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: