Recognising the user switch between Form view and Data sheet view

M

Mike Turner

My Uncle has an Access application where he would like to sometimes switch
from a Form's Form View to Data sheet view and back. He would like certain
settings for each view (eg form maximisable when in Data Sheet view but not
when in Form view,and certain fields hidden in data sheet view but visible in
text boxes in Form view. So,is there an event which is fired when the form's
view style is being changed,so that I could put appropriate coding there?
Either Access 2003 or 2007 could be used,preferably 2003.

I realize I could put a button on the form in form view, say,where I could
put code that handled any changes needed from Form view to Datasheet view but
it seems it would not be there when moving back form Data sheet view to Form
view!

Any suggestions welcome.Many thanks
 
J

Jon Lewis

I would question the design here. Generally datasheet view (and continuous
form view) are used to display multiple records in a sheet like format a bit
like a spreadsheet. To view further details for a specific record you would
normally open a different more detailed form in Single Form view.

So use two different forms here rather than try to modify one form according
to its View.

Alternatively, if you must use the same form then why dont you use
Continuous Forms view instead of Datasheet view. That way you can have a
button on each of the records to change to single form view with the coded
changes you need.

HTH
 
P

Paul Shapiro

Mike Turner said:
My Uncle has an Access application where he would like to sometimes switch
from a Form's Form View to Data sheet view and back. He would like certain
settings for each view (eg form maximisable when in Data Sheet view but
not
when in Form view,and certain fields hidden in data sheet view but visible
in
text boxes in Form view. So,is there an event which is fired when the
form's
view style is being changed,so that I could put appropriate coding there?
Either Access 2003 or 2007 could be used,preferably 2003.

I realize I could put a button on the form in form view, say,where I could
put code that handled any changes needed from Form view to Datasheet view
but
it seems it would not be there when moving back form Data sheet view to
Form
view!

I've done something like that to change the mode of a subform using a button
on the main form. That way the button is always available, even when the
subform has been switched to datasheet mode. If you're working with a single
main form, you could make that form a subform of an unbound main form that
just has the mode switch button.

You might be able to do something with a custom right-click context menu for
the form, but I haven't tried it.
 
M

Mike Turner

Jon, BruceM and Paul: Many thanks for your answers. I will now experiment
with your ideas.
 

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

Top