Open Form with a Command button and apply a preedefiend filter

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...
 
G

golfinray

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.
 
P

Peter

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...
 
G

golfinray

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...
 
P

Peter

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top