search

A

antonov

Hello again... I need to create a search form in which I need to define a
certain amount of parameters (Yes/No, if a certain textbox is empty, etc).
Can it be done?
 
J

John Vinson

Hello again... I need to create a search form in which I need to define a
certain amount of parameters (Yes/No, if a certain textbox is empty, etc).
Can it be done?

Sure. Make it an unbound form (don't pick any table or query when you
create it); let's say you call it frmCrit. Create a Query with
criteria like

Forms![frmCrit]![txtThis]

It's handy to base a Form (for onscreen display) and/or a Report (for
printing) based on this query, and put command buttons on frmCrit to
open them.

John W. Vinson[MVP]
 
A

antonov

Hello John, thanks for your reply but I may need to be more specific.
I need to create a form which will be opened by pressing a button in an
existing form. I need to be able to find records in the open form, by
inserting certain criteria. Let's say I want to see how many records are
"no" (yes/no check Box) or how many records have 297 in a specific text
box... or how many records have a specific weight in the weight textbox. I
need to be able to find the record by inserting one or more criteria.
I hope I don't come over too confused....
John Vinson said:
Hello again... I need to create a search form in which I need to define a
certain amount of parameters (Yes/No, if a certain textbox is empty, etc).
Can it be done?

Sure. Make it an unbound form (don't pick any table or query when you
create it); let's say you call it frmCrit. Create a Query with
criteria like

Forms![frmCrit]![txtThis]

It's handy to base a Form (for onscreen display) and/or a Report (for
printing) based on this query, and put command buttons on frmCrit to
open them.

John W. Vinson[MVP]
 
J

John Vinson

Hello John, thanks for your reply but I may need to be more specific.
I need to create a form which will be opened by pressing a button in an
existing form. I need to be able to find records in the open form, by
inserting certain criteria.

You can't find records in a Form. A Form doesn't contain records; a
table does. The form is just a window, a tool to view the data.
Let's say I want to see how many records are
"no" (yes/no check Box) or how many records have 297 in a specific text
box... or how many records have a specific weight in the weight textbox.

Do you want to FIND the records? Or do you want to COUNT the records?
These are quite different requirements.
I need to be able to find the record by inserting one or more criteria.
I hope I don't come over too confused....

Well, I hope I'm not coming over as too confusing!

It SOUNDS like you want to just set the Filter property of the form,
or use Filter by Form. Have you investigated this technique? Use the
Filter by Form icon on the toolbar and see if this gets you what you
want.

John W. Vinson[MVP]
 
A

antonov

John, the filter by form is exactely what I was looking for. Thanks for the
hint
 
Top