Access Run Time

  • Thread starter Thread starter dhstein
  • Start date Start date
D

dhstein

I configured Access run time to run my database on other systems. It works
fine, but when I run a command which opens a query, the query stays open and
can't be closed. I believe this is an intended part of runtime to prevent
users from doing any damage, but how can I get around that? I guess one
possibility is to close the query when the mouse focus changes, but I'm not
sure it that's a VBA recognized event and maybe there is another/better idea.
Any suggestions are appreciated.
 
I configured Access run time to run my database on other systems. It
works fine, but when I run a command which opens a query, the query
stays open and can't be closed. I believe this is an intended part of
runtime to prevent users from doing any damage, but how can I get around
that? I guess one possibility is to close the query when the mouse
focus changes, but I'm not sure it that's a VBA recognized event and
maybe there is another/better idea.
Any suggestions are appreciated.

There is nothing about the runtime that should prevent closing a query.
What happens when they press the red [X] in the corner, nothing?
 
I configured Access run time to run my database on other systems. It works
fine, but when I run a command which opens a query, the query stays open and
can't be closed. I believe this is an intended part of runtime to prevent
users from doing any damage, but how can I get around that? I guess one
possibility is to close the query when the mouse focus changes, but I'm not
sure it that's a VBA recognized event and maybe there is another/better idea.
Any suggestions are appreciated.

One suggestion would be... don't open query datasheets *at all*!

Instead base a Form on the query, and open the Form. That gives you a lot more
control over the user interaction.
 
Rick Brandt said:
I configured Access run time to run my database on other systems. It
works fine, but when I run a command which opens a query, the query
stays open and can't be closed. I believe this is an intended part of
runtime to prevent users from doing any damage, but how can I get around
that? I guess one possibility is to close the query when the mouse
focus changes, but I'm not sure it that's a VBA recognized event and
maybe there is another/better idea.
Any suggestions are appreciated.

There is nothing about the runtime that should prevent closing a query.
What happens when they press the red [X] in the corner, nothing?


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Rick,

My code is like this:

Private Sub btnChoice1_Click()

' Some code here

DoCmd.OpenQuery "qryEvent1", acViewNormal, acEdit

' More code here

End Sub


So I don't get a red X in the corner.
 
John W. Vinson said:
One suggestion would be... don't open query datasheets *at all*!

Instead base a Form on the query, and open the Form. That gives you a lot more
control over the user interaction.

I'll try to base a form on the query. I would have liked to keep the
number of forms down, but maybe that's a better way. I'll have to play with
it and see what happens. Any directions on what I need to do to base a form
on a query? Create a form and run the query on a form load event ? I would
appreciate any additional help. Thanks.
 
I'll try to base a form on the query. I would have liked to keep the
number of forms down, but maybe that's a better way. I'll have to play with
it and see what happens. Any directions on what I need to do to base a form
on a query? Create a form and run the query on a form load event ? I would
appreciate any additional help. Thanks.

Query datasheets are inflexible as data presentation vehicles, and give the
user the ability to do things like hide or move columns (which may cause them
confusion later). I *NEVER* let users see datasheets in production
applications!

It's dead simple to create a form using a Query as its recordsource. In fact
the Form design window asks you right up front which table or query to use.
Just create your query, then create a form based on it - or even use the
Autoform toollbar option and then customize the form to suit your needs.
Absolutely NO code is required.
 
John W. Vinson said:
Query datasheets are inflexible as data presentation vehicles, and give the
user the ability to do things like hide or move columns (which may cause them
confusion later). I *NEVER* let users see datasheets in production
applications!

It's dead simple to create a form using a Query as its recordsource. In fact
the Form design window asks you right up front which table or query to use.
Just create your query, then create a form based on it - or even use the
Autoform toollbar option and then customize the form to suit your needs.
Absolutely NO code is required.
 
One suggestion would be... don't open query datasheets *at all*!

Instead base a Form on the query, and open the Form. That gives you a
lot more control over the user interaction.

I agree, but does his code actually open a query datasheet without a
close button? I have never seen a datasheet without a close button.
 
You said (reformatted to break lines:)


I apologize for not being clearer about what I need. It may be that this
method will work, but here's the situation. I have a form with a button (one
of several buttons for user options), that provides an inputbox to the user.
When he enters data there, this input is used as part of the query to return
specific records. This query is then displayed. So I'm not sure how I would
do that by creating a form based on the query. Also, would the user then have
a different form for that menu choice ? Maybe there's a better control to use
for the user to provide input? Thanks for any help.

I'm not sure of your whole situation. My *inclination* based on what little I
know would be to instead have a Form based on the table containing the data
that you want to display, or on a Query combining the tables that you want to
display; put unbound controls (combo boxes, textboxes, or whatever) into which
the user can enter or select their search criteria; and have a button that
either filters the Form to display the selected records, or jumps to the
desired record if the user will want to browse back and forth.

Inputbox calls are rather hard to work with both for you and for the user! I
rarely use them; Forms are more flexible and less intrusive for the user.
Don't be scared of forms! They're an absolutely essential tool for any
productive use of Access.
 
Rick Brandt said:
I agree, but does his code actually open a query datasheet without a
close button? I have never seen a datasheet without a close button.


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Rick,

Yes, the code opens a query datasheet without a close button.
 

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

Back
Top