Open Form with a Command button and apply a preedefiend filter

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

HI all again...i am closed to conclude my Access creation :-)
I want to open a form from my new menu with a command button and the form
should be filtered with certain criterias...
 
Us the regular command button wizard to set up the open form. The add a combo
box to the form. Allow the wizard to set up whatever you want to search on,
usually a id number, project number, customer name or whatever. Then right
click on the combo to get properties. Go to events, then the afterupdate
event, click the little button out to the right and start the code builder.
Type:
Me.filter = "[your id] = """ & me.combo# & """"
Me.filteron = true
The combo number will be listed, like combo 10 or combo22
Now when you select the item from the combo, that item will come up on your
form.
 
Thanks golfinray...
Can i use the IIf expression in the filtering?...
or...IIF [open or review]And[Date created=Date()] etc etc i only wnat those
records that include Open or Review where the Created date equals today..?

golfinray said:
Us the regular command button wizard to set up the open form. The add a combo
box to the form. Allow the wizard to set up whatever you want to search on,
usually a id number, project number, customer name or whatever. Then right
click on the combo to get properties. Go to events, then the afterupdate
event, click the little button out to the right and start the code builder.
Type:
Me.filter = "[your id] = """ & me.combo# & """"
Me.filteron = true
The combo number will be listed, like combo 10 or combo22
Now when you select the item from the combo, that item will come up on your
form.

Peter said:
HI all again...i am closed to conclude my Access creation :-)
I want to open a form from my new menu with a command button and the form
should be filtered with certain criterias...
 
try
If not isnull(me.[open or review]and (me.[date created])=now() then
me.filter.....
me.filteron.....
end if
end sub
You may have to play with that a little.

Peter said:
Thanks golfinray...
Can i use the IIf expression in the filtering?...
or...IIF [open or review]And[Date created=Date()] etc etc i only wnat those
records that include Open or Review where the Created date equals today..?

golfinray said:
Us the regular command button wizard to set up the open form. The add a combo
box to the form. Allow the wizard to set up whatever you want to search on,
usually a id number, project number, customer name or whatever. Then right
click on the combo to get properties. Go to events, then the afterupdate
event, click the little button out to the right and start the code builder.
Type:
Me.filter = "[your id] = """ & me.combo# & """"
Me.filteron = true
The combo number will be listed, like combo 10 or combo22
Now when you select the item from the combo, that item will come up on your
form.

Peter said:
HI all again...i am closed to conclude my Access creation :-)
I want to open a form from my new menu with a command button and the form
should be filtered with certain criterias...
 
I will play around with that over the weekend, Thanks a lot, really!



golfinray said:
try
If not isnull(me.[open or review]and (me.[date created])=now() then
me.filter.....
me.filteron.....
end if
end sub
You may have to play with that a little.

Peter said:
Thanks golfinray...
Can i use the IIf expression in the filtering?...
or...IIF [open or review]And[Date created=Date()] etc etc i only wnat those
records that include Open or Review where the Created date equals today..?

golfinray said:
Us the regular command button wizard to set up the open form. The add a combo
box to the form. Allow the wizard to set up whatever you want to search on,
usually a id number, project number, customer name or whatever. Then right
click on the combo to get properties. Go to events, then the afterupdate
event, click the little button out to the right and start the code builder.
Type:
Me.filter = "[your id] = """ & me.combo# & """"
Me.filteron = true
The combo number will be listed, like combo 10 or combo22
Now when you select the item from the combo, that item will come up on your
form.

:

HI all again...i am closed to conclude my Access creation :-)
I want to open a form from my new menu with a command button and the form
should be filtered with certain criterias...
 
Back
Top