running a querys using a form

  • Thread starter zaps via AccessMonster.com
  • Start date
Z

zaps via AccessMonster.com

Hi everybody. I have a few questions I'm hoping someone can help me with:

1. I have a command button on a form that runs 2 querys. First query is to
select the information between a date range and the second query is to do a
count (total). I would like the second query results to pop up in front of
the form. I don't need to see the results from the first query.

2. I also have a command button to run a report. This does pop up in front
of the form, but I would like to be able to see the toolbar that contains
File>Print, so that users can report out the report.

Thanks very much,
Zaps
 
G

Guest

Zaps:

If you don't need to see the results of the first query then why open it at
all? Just open the second query which returns the count. If this second
query references the first one you don't have to open it independently, the
second one will reference it transparently behind the scenes. If you are
simply counting the rows returned by the first query you might not even need
to open the second one, but instead use the DCount function to count the
rows. You could just open an unbound dialogue form on top of the first form:

DoCmd.OpenForm "frmCountRows", WindowMode:=acDialog

The frmCountRows form would have a text box on it with a ControlSource such
as:

=DCount("*","YourFirstQuery")

I don't understand your second question. As After opening a report in print
preview you should get the normal report menu and toolbar while the report
has the focus.

Ken Sheridan
Stafford, England
 
Z

zaps via AccessMonster.com

Thanks Ken! Works Great!

For my other question, I think I need to explain it better (or try to). When
the user signs onto the database, the form opens to "add new entry". Users
do not have any excess to go behind the form, or do anything other than use
the buttons on the form. The form takes up the whole screen, and does not
show any toolbars. When the user clicks the button to run a report, the
report pops up in front of the from, but does not show any toolbars either.
The top of the report shows the name of the report (rpt_SurveyDetails) and
thats it.

Thanks again,
Zaps

Ken said:
Zaps:

If you don't need to see the results of the first query then why open it at
all? Just open the second query which returns the count. If this second
query references the first one you don't have to open it independently, the
second one will reference it transparently behind the scenes. If you are
simply counting the rows returned by the first query you might not even need
to open the second one, but instead use the DCount function to count the
rows. You could just open an unbound dialogue form on top of the first form:

DoCmd.OpenForm "frmCountRows", WindowMode:=acDialog

The frmCountRows form would have a text box on it with a ControlSource such
as:

=DCount("*","YourFirstQuery")

I don't understand your second question. As After opening a report in print
preview you should get the normal report menu and toolbar while the report
has the focus.

Ken Sheridan
Stafford, England
Hi everybody. I have a few questions I'm hoping someone can help me with:
[quoted text clipped - 9 lines]
Thanks very much,
Zaps
 
Z

zaps via AccessMonster.com

I have been fiddling around with the yes/no in the modal (in the form
properties under other). When I try and run the report now I get this error
message:

Run-time error '7794'
Microsoft Office Access couldn't find the toolbar ' '.

Help! What have I done!
Thanks Ken! Works Great!

For my other question, I think I need to explain it better (or try to). When
the user signs onto the database, the form opens to "add new entry". Users
do not have any excess to go behind the form, or do anything other than use
the buttons on the form. The form takes up the whole screen, and does not
show any toolbars. When the user clicks the button to run a report, the
report pops up in front of the from, but does not show any toolbars either.
The top of the report shows the name of the report (rpt_SurveyDetails) and
thats it.

Thanks again,
Zaps
[quoted text clipped - 25 lines]
 
G

Guest

Zaps:

I'd drafted the reply below just before seeing your latest post. It sounds
as though you might possibly be using the Modal and Popup properties to
control the form after all. My recommendation would be to set both to False
(No in the properties sheet), to maximize the form on opening if you want it
to fill the application window, and to create a custom menu and toolbar for
your reports. Deny access to menus and built in toolbars in the start up
dialogue (you can by-pass the start up options for development purposes by
holding down the Shift key when you open the application – though that too
can be disabled, but that's another story). In the same dialogue give the
application a suitable title, and icon if you wish; these will show on the
application window's title bar. Make sure the Menu and Toolbar properties
for all forms are left blank unless you design custom menus/toolbars for them
too. You'll then just get the minimal menu with them.

To my mind the overall effect of running an application within its own
maximized and appropriately titled window is much better than filling the
screen with one giant form and accords with users' experience generally when
running Windows applications, i.e. within Windows.

FWIW here's my original reply:

Sounds like you might be either opening the database with a maximized form
whose modal and pop up properties are both set to True; this fills the screen
with the form and hides everything else including the Access window itself.
Or you might be denying access to full menus and built in toolbars in the
start up options; this shows only a minimal menu bar. From what you say my
guess would be that it’s the latter of these. While I've seen the former
done, its not an approach I'd recommend.

When you deny full menus and built in toolbars this is usually when you
include custom menus and toolbars in the application, attaching the relevant
one's to each form or report object as their MenuBar and Toolbar properties.
You can then include whatever menu items/toolbar buttons you want for each
form or report object. As you'll generally want the same options to be
available for all reports you only need design one menu and toolbar which you
can use for all of them. With forms the options will probably differ from
form to form so more custom menus and toolbars would be required. Many
people rely on command buttons on forms rather than menu or toolbar buttons,
however, so one approach would be to use custom menus/toolbars for reports
only.

If you do use custom menus and toolbars resist the temptation to include too
much in them. I once had to do some work on a database developed by somebody
else which had so many options available via the custom menus that the result
was one of almost total confusion for the user!

Ken Sheridan
Stafford, England

zaps via AccessMonster.com said:
I have been fiddling around with the yes/no in the modal (in the form
properties under other). When I try and run the report now I get this error
message:

Run-time error '7794'
Microsoft Office Access couldn't find the toolbar ' '.

Help! What have I done!
Thanks Ken! Works Great!

For my other question, I think I need to explain it better (or try to). When
the user signs onto the database, the form opens to "add new entry". Users
do not have any excess to go behind the form, or do anything other than use
the buttons on the form. The form takes up the whole screen, and does not
show any toolbars. When the user clicks the button to run a report, the
report pops up in front of the from, but does not show any toolbars either.
The top of the report shows the name of the report (rpt_SurveyDetails) and
thats it.

Thanks again,
Zaps
[quoted text clipped - 25 lines]
Thanks very much,
Zaps
 

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

Similar Threads

command button to run 2 querys 3
Querys based on Querys 7
Query help 3
INVOICE 2
Access Access Report Works on One Machine but not Another 3
multiple web querys 4
Counts in Querys (and reports) 3
WEIRD parameter window issue 2

Top