datasheet view 2007 without saving column layout changes


M

mary r

I have a customer who wants a grand unified datasheet to play with his data
without editing it. The sorting and filtering in the Access 2007 datasheet
views is just the ticket; I've created a form with no editing privileges but
with filters allowed and had the switchboard open it in datasheet view.

The problem is that when a user changes the column layout, for example, to
print the data he has just sorted and filtered in the way he wants it, he is
prompted about saving changes when the form closes. SendKeys seems to have
gone away; placing the datasheet into a larger form whose Close button code
specifies no saves for both the subform and the main form does not prevent
the prompt. With the subform (datasheet) called "Query1" and the main form
"Grand Unified Theory," here is the code:

Private Sub Command0_Click()
DoCmd.Close acForm, "Query1", acSaveNo
DoCmd.Close acForm, "Grand Unified Theory", acSaveNo
End Sub

I really hope someone can help!

TIA-
mary
 
Ad

Advertisements

M

Mark Andrews

If you always just want to save the form changes and suppress all user
prompts you can just call

DoCmd.Save

For example, I use datasheets all the time and have button to hide/show
columns that has the code

Private Sub showHideColumns_Click()

DoCmd.RunCommand acCmdUnhideColumns
DoCmd.Save

End Sub

If I leave out the DoCmd.Save the user is prompted to save changes to the
form (after they hide/show some columns).

HTH,
Mark Andrews
RPT Software
http://www.rptsoftware.com
 
Ad

Advertisements

M

Mark Andrews

Dirk went out and wrote some nice code to make this saving possibly in an
ACCDE (where a simple DoCmd.Save will NOT work). It involves a table to
save/restore the column order, visibility etc....

Cantact me at http://www.rptsoftware.com if you need to get code for this.

Mark
 

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