form by filter HELP PLEASE!!!!!!

  • Thread starter Thread starter nydia
  • Start date Start date
N

nydia

I'm creating a basic database for a job placement program.
It has 1 table, with client information (i.e. address,
phone number and jobgoal, which is what type of job they
want) example of a jobgoal would be secretary. I'm trying
to make it as simple as possible, because the users are
not familiar with access.

When a job become available I want the user to be able to
search for eligible clients. Sometimes the user will want
to search by one field (ex.zip code alone) or sometime
search by 2 fields (zip code and jobgoal). If I open up
the main form and click on filter by form, it great, cuz I
can pick what fields I want to search by. I want to
create a form that when it opens, it will open in the
filter by form (so that the user doesn't have to click on
filter by form). the only option it gives me is save as
query. which doesn't work because when I do save it as a
query and reopen the form I still have to click on filter
by form to select what fields I want to search by. What
options do I have. I'm not an access expert, so writing my
own codes won't work. any suggestions is greatly
appreciated.
 
I would suggest creating a form (frmSEARCH) using the
form wizard. Select the "1 table" as your datasource.
After the form is created, select each text box and
delete the "Control Source" property from each one. This
should cause them to be displayed as "unbound".

Next, create a query that includes all of the fields from
your "1 table". The criteria for each field in your
query could be as follows: like "*" and [forms]!
[frmSEARCH]![field_name] . I would recommend using the
expression builder so that you do not get the names
wrong. This criteria looks for records that match
anything you type into the text boxes on frmSEARCH.

Finally, you can make a command button and place it on
frmSEARCH. The command button can open the query you
just created. This can be accomplished using the command
button wizard, or you can write a macro with OpenQuery as
the action and [query_name] as the object. I hope this
helps. DV
 
Thanks for all your help. I did what you said, but when i
test it and click on the search command button that I
created, it opens the query and there are no records. How
does the command button know to search for what I typed in
the text boxes??

In the criteria for zip code, which the name is zip, I
typed:
like "*" and [forms]![frmSEARCH]![zip] IS THIS CORRECT??

thanks for all your help
-----Original Message-----
I would suggest creating a form (frmSEARCH) using the
form wizard. Select the "1 table" as your datasource.
After the form is created, select each text box and
delete the "Control Source" property from each one. This
should cause them to be displayed as "unbound".

Next, create a query that includes all of the fields from
your "1 table". The criteria for each field in your
query could be as follows: like "*" and [forms]!
[frmSEARCH]![field_name] . I would recommend using the
expression builder so that you do not get the names
wrong. This criteria looks for records that match
anything you type into the text boxes on frmSEARCH.

Finally, you can make a command button and place it on
frmSEARCH. The command button can open the query you
just created. This can be accomplished using the command
button wizard, or you can write a macro with OpenQuery as
the action and [query_name] as the object. I hope this
helps. DV
-----Original Message-----
I'm creating a basic database for a job placement program.
It has 1 table, with client information (i.e. address,
phone number and jobgoal, which is what type of job they
want) example of a jobgoal would be secretary. I'm trying
to make it as simple as possible, because the users are
not familiar with access.

When a job become available I want the user to be able to
search for eligible clients. Sometimes the user will want
to search by one field (ex.zip code alone) or sometime
search by 2 fields (zip code and jobgoal). If I open up
the main form and click on filter by form, it great, cuz I
can pick what fields I want to search by. I want to
create a form that when it opens, it will open in the
filter by form (so that the user doesn't have to click on
filter by form). the only option it gives me is save as
query. which doesn't work because when I do save it as a
query and reopen the form I still have to click on filter
by form to select what fields I want to search by. What
options do I have. I'm not an access expert, so writing my
own codes won't work. any suggestions is greatly
appreciated.
.
.
 
In the criteria for zip code, which the name is zip, I
typed:
like "*" and [forms]![frmSEARCH]![zip] IS THIS CORRECT??

No, it is not. I think the person who posted originally must have
been a bit sleepy...

Try

LIKE [forms]![frmSEARCH]![zip] & "*"

This will find an exact zipcode if it's entered, all the 83 zipcodes
if the user types 83, and all records in the table if the user leaves
the control blank.
 
Thank you so much, it works!!!! your help is greatly
appreciated. :)
-----Original Message-----
In the criteria for zip code, which the name is zip, I
typed:
like "*" and [forms]![frmSEARCH]![zip] IS THIS
CORRECT??

No, it is not. I think the person who posted originally must have
been a bit sleepy...

Try

LIKE [forms]![frmSEARCH]![zip] & "*"

This will find an exact zipcode if it's entered, all the 83 zipcodes
if the user types 83, and all records in the table if the user leaves
the control blank.


.
 
Back
Top