disable the subform option on a datasheet view

  • Thread starter kscheu via AccessMonster.com
  • Start date
K

kscheu via AccessMonster.com

I have a subform the opens in datasheet view by default. I want to allow
only custom shortcuts , but if you right click on the column header, a
shortcut menu with options Subform, sort asc, sort desc, copy, column width,
hide, freeze and unfreeze, pop up. I do not want to allow the user to
select any other view type. In the forms properties, I set all other views
to No, but if the user selects Datasheet View from the shortcut, The
recordsource changes and no rows are displayed. I am setting the
recordsource of the subform thru VBA.

How can I disable the Subform option all together?

Thanks,
KS
 
J

John Vinson

How can I disable the Subform option all together?

I'd suggest by using Continuous view instead of Datasheet view.
Datasheet just gives the user too much ability to muck around.

If you're dynamically changing the Recordsource this will be much
harder, as you'll need to programmatically create controls! May I ask
why it's necessary to do so?

John W. Vinson[MVP]
 
K

kscheu via AccessMonster.com

Hi John,

The reason I dynamically create the record source is because I have a main
form that contains main filters such as date range, report type (orders or
sales) , etc. Also on the main form are sub filters such as country, state,
salesman, item, etc.

The main form defaults the main filters on open and recordsource or sub form
is set. If a main form filter changes, I resset the recordsource of the
subform. If a sub filter is selected, I modify the current subform's
recordsource by looping through all the sub filters (9 of them) and building
the recordsource.

Any suggestions on a different approach.

Thanks,
Karen
 
J

John Vinson

Hi John,

The reason I dynamically create the record source is because I have a main
form that contains main filters such as date range, report type (orders or
sales) , etc. Also on the main form are sub filters such as country, state,
salesman, item, etc.

The main form defaults the main filters on open and recordsource or sub form
is set. If a main form filter changes, I resset the recordsource of the
subform. If a sub filter is selected, I modify the current subform's
recordsource by looping through all the sub filters (9 of them) and building
the recordsource.

If you're only changing the *criteria* rather than the fields being
displayed, you can still use a Continuous form (displaying a constant
set of fields). Changing the criteria won't require changing the
structure of the form.

John W. Vinson[MVP]
 

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