Create Form Run Query Display in Form

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

Guest

Hi,
Im trying to create a form for searching. I want that form to be able to
once a button is clicked, run queries on selected fields and return all data
associated with those records in a Form View.

Please help

thanks
 
Hi,
Im trying to create a form for searching. I want that form to be able to
once a button is clicked, run queries on selected fields and return all data
associated with those records in a Form View.

Please help

thanks

Create a Query using the form's fields as criteria: e.g.

=[Forms]![formname]![controlname] OR [Forms]![formname]![controlname]
IS NULL

on the Criteria line for each field that you want to search.

Create a new Form based on this query displaying the data you want to
see.

Put a command button on the first form to open the second form (use
the command button wizard).

John W. Vinson[MVP]
 
Thank you,
Im still having a problem. here is what I did, if you could help.
I created a form based on a table that has data in it. I then created a
query based on that form with a command button. I then created a new form
based on that query. The command button is linked to open the second form.

the problem i had was when i opened up my first form, the data was already
in it. I could not add new data. I think i needed a blank form to type in
what i am searching for, but the data for the records were there, also it
wouldnt let me add new records, which is good becuase this is just for
searching, but I could not type in anything to search for.

Please help if you can.

thank you in advance

titan

John Vinson said:
Hi,
Im trying to create a form for searching. I want that form to be able to
once a button is clicked, run queries on selected fields and return all data
associated with those records in a Form View.

Please help

thanks

Create a Query using the form's fields as criteria: e.g.

=[Forms]![formname]![controlname] OR [Forms]![formname]![controlname]
IS NULL

on the Criteria line for each field that you want to search.

Create a new Form based on this query displaying the data you want to
see.

Put a command button on the first form to open the second form (use
the command button wizard).

John W. Vinson[MVP]
 
Im still having a problem. here is what I did, if you could help.
I created a form based on a table that has data in it. I then created a
query based on that form with a command button. I then created a new form
based on that query. The command button is linked to open the second form.

the problem i had was when i opened up my first form, the data was already
in it. I could not add new data. I think i needed a blank form to type in
what i am searching for, but the data for the records were there, also it
wouldnt let me add new records, which is good becuase this is just for
searching, but I could not type in anything to search for.

There's something else wrong with your first form, then. If it won't
let you add data, you can check the Form's AllowAdditions and
AllowEdits properties (they should both be True if you want to do so);
you also need to be sure that the form is based upon an updateable
Query or else directly on a Table.


John W. Vinson[MVP]
 
thank you for your help but im still having trouble.

i created a form based on a query. the query was based on a 2 different
tables. i think that because its a query, its not letting me add data. i
checked the form properties and they are all set to yes. im not sure why the
data of the first record comes up in the form, and then why i cant type in
data. maybe its to prevent me from entering data that would overwrite the
table data, which is a good thing. i need to be able to enter the data in a
clean form and then be able to search. this is for other people to use
constantly so form by filter wont work becuase they dont know how to use it.
Please help if you can and give me detailed instructions on how to set up the
form, table, query, ect... The search parameters that i entered into on the
query work when i hit the search button that i created. its just the form is
already filled with data before i search.

thank you for your patience

titan
 
thank you for your help but im still having trouble.

i created a form based on a query. the query was based on a 2 different
tables. i think that because its a query, its not letting me add data.

Some queries are updateable; some are not. Try opening the Query in
datasheet view - is there a "new record" line? If not, check the table
definitions: do you have a unique Index (such as a Primary Key) on the
field in the "one" side table that you're using for the join? That's
essential, and a common cause of this problem. If that's not it,
please open the Query in SQL view and post the SQL text here.
i checked the form properties and they are all set to yes. im not sure why the
data of the first record comes up in the form, and then why i cant type in
data. maybe its to prevent me from entering data that would overwrite the
table data, which is a good thing. i need to be able to enter the data in a
clean form and then be able to search.

Then you MUST - NO OPTION - use an Unbound form. A Query is not a
separate reality from its table; editing the query edits the table,
the query is just a view of the table.
this is for other people to use
constantly so form by filter wont work becuase they dont know how to use it.
Please help if you can and give me detailed instructions on how to set up the
form, table, query, ect... The search parameters that i entered into on the
query work when i hit the search button that i created. its just the form is
already filled with data before i search.

Use a different form, a Form with nothing in its Recordsource
property, to collect your criteria.

John W. Vinson[MVP]
 
Back
Top