Opening a form via a query

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

Guest

I have done this before but have forgotten and cannot find it on Help. I
have a query to find a student by surname but I wish the result to open in a
Form. How do I do this? Any urgent help would be appreciated.
Mel
 
I have done this before but have forgotten and cannot find it on Help. I
have a query to find a student by surname but I wish the result to open in a
Form. How do I do this? Any urgent help would be appreciated.
Mel

Just create a form (you can just use the Form Wizard if you wish)
based on your Query. If you have an input criteria listing in your
query it will prompt for the Students Surname before the form opens,
then display the relevant information after the user has input the
Surname.
 
I have done this before but have forgotten and cannot find it on Help. I
have a query to find a student by surname but I wish the result to open in a
Form. How do I do this? Any urgent help would be appreciated.
Mel

Turn your thinking around.

Don't have the Query open a Form. Instead, use the Query as the Form's
Recordsource... and just open the form. It's not necessary to "run" the query
at all.

John W. Vinson [MVP]
 
Thanks for all your quick replies - I have a command button in an existing
form that runs a query which used to open another form. I have changed the
form that I wish it to open and now whenever I run the same query it opens my
result in spreadsheet view not in form view. I guess I should have been
clearer!!! I did go into the Event Builder and just tried to sneakily change
the form name but this didn't work!

So I want my query to open in form view not spreadsheet view....
 
Thanks for all your quick replies - I have a command button in an existing
form that runs a query which used to open another form. I have changed the
form that I wish it to open and now whenever I run the same query it opens my
result in spreadsheet view not in form view. I guess I should have been
clearer!!! I did go into the Event Builder and just tried to sneakily change
the form name but this didn't work!

So I want my query to open in form view not spreadsheet view....







- Show quoted text -

- First create a form based on your Surname Search Query.
- Go back to your original form...the one with the button that calls
the query currently
- Create a new Command Button, when the Wizard pops up choose "Form
Operations" and then "Open Form" from the actions listbox.
- Select the form you just created from the Listbox
- Click Next/Finish and that should be done

This is if you've already got your criteria pulling from your
Query...if you have the original form with a Textbox on it with "Find
Surname: ________" or similar, then you will need to load the new form
with a Filter applied to find that surname...but it sounds to me like
you already had that part covered (probably by putting [Surname] in
your Criteria for that field in the query).

You cannot "open a query in form view" unless you've created the form
already. A form view doesn't exist until you've created the form!
 
Melza said:
I have done this before but have forgotten and cannot find it on Help. I
have a query to find a student by surname but I wish the result to open in a
Form. How do I do this? Any urgent help would be appreciated.
Mel

Melza,

Queries cannot open forms (or at least they are not meant to do so).

Just create a VBA subroutine in an MS Access Module with the code to
open a form, and attach that code to whatever button or other GUI
interface element needs it.


Sincerely,

Chris O.
 
Melza said:
Thanks for all your quick replies - I have a command button in an existing
form that runs a query which used to open another form. I have changed the
form that I wish it to open and now whenever I run the same query it opens my
result in spreadsheet view not in form view. I guess I should have been
clearer!!! I did go into the Event Builder and just tried to sneakily change
the form name but this didn't work!

So I want my query to open in form view not spreadsheet view....

Melza,

Open up one of your pre-change archived backup copies of your
database.

Examine it for the differences between what you have now, and what you
had before.


Sincerely,

Chris O.
 
Back
Top