close table restore form

J

javablood

I have a form from which I make a table and update the table. I then have
the user review the table before exporting it. So I minimize the form and
open the table. How do I restore the form once the table is closed?

thanks,
 
J

Jeff Boyce

I'm having trouble following your description...

In my experience, I can't "make a table ... from a form" -- how are you
doing that?

How are you having your "user review the table"? In a query? In a form?

Even though Access tables look like spreadsheets, they aren't. Exposing
them (tables) to users is likely to confuse them into thinking they're
dealing with spreadsheets.

Access tables store data, Access form display it on-screen. Use forms
instead...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

javablood

From a form, I have an event procedure within which I have run a query to
make a table (from information within two other tables) and then I update the
table to make sure the locations are spelled correctly, etc. before I export
it to another database for final resting. The review of the table is just to
make sure that everything looks correct before export. So, when the table is
open (see below), the form is minimized. Now, when the table is closed I
want the form to be restored so the user can now export the table.

DoCmd.SelectObject acForm, "frmRun"
DoCmd.Minimize
DoCmd.OpenTable "tblSWTPZnew", acViewNormal, acReadOnly

How is this accomplished?

thanks,
 
J

Jeff Boyce

Having your users mucking-about in the tables is not a preferred or
recommended approach.

That said, since you used one command to set the focus to the form and the
next command to minimize it, take a look at Access HELP for the syntax on
setting focus to the form (again) and maximizing it.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

javablood

Jeff,

Thank you for your advice and that is why I have the table 'read only'. I
did try to restore the form in the events gotfocus, lostfocus, etc. but to no
avail. I have searched the help and the discussion groups also to no avail.
I am confused by the fact that t thought the focus is on the table when I
open it (read only) but not sure how to shift the focus back to the form
after the table is closed.

thank you,
 
J

Jeff Boyce

I'll mention again, then, that many folks who work with Access daily
recommend against trying to work directly in the tables.

Best of luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

javablood

Jeff,

Thank you. So if I open the data in form to preview will you then tell me
if there is a way to close a table and then shift focus back to the form? :)
 
S

Stuart McCall

javablood said:
Jeff,

Thank you. So if I open the data in form to preview will you then tell me
if there is a way to close a table and then shift focus back to the form?
:)
<snip>

Jeff's giving you some great advice but you don't seem to be listening. A
professionally created Access application will *never* show a Table to the
user. Tables are for designing and storing data, period.

Try this:

Select the table in question in the database window (or better still, create
a Query which draws data from the table). From the Insert menu, select
'AutoForm'. When Access is done creating the form for you, open the form to
make sure you can see the correct data (well one record of it). Now go to
the 'View' menu and select 'Datasheet". Notice that this looks like a table
but is really a form. Now that you've got a form you can address your
problem by putting this code:

DoCmd.Restore

in the form's Close event.

This is something you can't do with tables, anyway. Tables and Queries
cannot contain code, but forms and reports can.
 
J

javablood

Stuart,

That is exactly what I did as indicated in my last post. I was trying
lighthearted sarcasm and added the smile, which was evidently lost. However,
it would be helpful in the future if the question is answered in the first
place as you did in your post when you stated "This is something you can't do
with tables, anyway. " I am learning from you all but sometimes I find that
direct answers are not always forthcoming. I agree that using the form to
display the data is the better way to go for so many reasons and I thank you
all for pointing that out to me. I am not a 'professional' Access developer
but with the likes of you all I am least learning. NHNF!
 
J

Jeff Boyce

I can only speak for myself and my approach...

Often I will deliberately NOT answer the question as asked, as it seems to
reflect a mind already made up, or inaccurate understanding of Access or
lack of clarity (i.e., I don't understand), or ...

I'll ask for information if I don't understand.

I'll offer ideas about effective use of the tools Access offers.

I'll point out potential issues with approaches.

I'll point out potential issues with learning to use Access & creating
applications.

(and if none of those seem applicable, I'll offer a solution).

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

javablood

Jeff,

Fair enough! In this case however, a lot of back and forth could have been
avoided if I heard that 1. do not allow the user to see table use forms
(which is what you did offer) and 2. one cannot close a table and open a form
(which is what I was trying to do incorrectly because of my inaccurate
understanding of Access).

I value very much the advice that I receive in these groups and use them to
better my product and my understanding of Access. In fact, I get more from
these groups than I do using the Help or Access 2007 Inside Out (I hope I
did not offend anyone but it is true).

Anyway, NHNF (no harm no foul) and thanks for your advice!
 
S

Stuart McCall

comments inline:

javablood said:
Stuart,

That is exactly what I did as indicated in my last post. I was trying
lighthearted sarcasm and added the smile, which was evidently lost.

I did indeed miss seeing your smiley, so I apologise for my tone.
However,
it would be helpful in the future if the question is answered in the first
place as you did in your post when you stated "This is something you can't
do
with tables, anyway. " I am learning from you all but sometimes I find
that
direct answers are not always forthcoming.

Sometimes it can be difficult to determine a poster's experience level, so
certain things are assumed, such as knowing that tables and queries cannot
host VBA code. And misunderstandings can result.
I agree that using the form to
display the data is the better way to go for so many reasons and I thank
you
all for pointing that out to me.
I am not a 'professional' Access developer

As it happens neither am I, at least not any more. I'm retired. (and perhaps
'experienced' would have been a better word choice)
but with the likes of you all I am least learning. NHNF!

You're very gracious.
 

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


Top