Filter Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I need to filter on two different fields and am having
trouble doing this.

On the first form, I have a command button. When you click this command
button, I want to bring up a second form that is filtered to the pull only
the information for the [Division] and [Element Number] fields matching the
[Division] and [Element Number] fields in the first form.

At this time, I have it filtering by [Division]. It works up to the point
that it only pulls that division's information. However, it pulls every
element number for that division, of which there are 12. If I change the
button to filter on [Element Number] it pulls up only that element number,
but it pulls for every division.

Is it possible to filter on two fields? Thank you in advance!
 
Try following the tutorial's on this website, it will work wonders for you

http://www.fontstuff.com/access/acctut18.htm
or
http://www.fontstuff.com/access/acctut19.htm

I have a form that I need to filter on two different fields and am having
trouble doing this.

On the first form, I have a command button. When you click this command
button, I want to bring up a second form that is filtered to the pull only
the information for the [Division] and [Element Number] fields matching the
[Division] and [Element Number] fields in the first form.

At this time, I have it filtering by [Division]. It works up to the point
that it only pulls that division's information. However, it pulls every
element number for that division, of which there are 12. If I change the
button to filter on [Element Number] it pulls up only that element number,
but it pulls for every division.

Is it possible to filter on two fields? Thank you in advance!
 
You can filter on multiple fields. This can be done easily upon opening a new
form.
example: DoCmd.OpenForm "Form2", , , "[Division]=" & varDiv & " And [Element
Number]=" & varElement
 
Back
Top