Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2008

Tip: Looking for answers? Try searching our database.

Close Form/Subform without Saving Changes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TulsaPilot - 30 Apr 2008 02:02 GMT
Gang,

I'm programmatically modifying the foreground property of some text controls
on a continuous subform for formatting purposes.  When I close the main form
it wants to save both main and subform which I don't want the users to see /
deal with.  I've searched and searched and tried a few ways to force it to
close without saving (including "docmd.close yada, yada, acSaveNo" and some
code involving "DestroyWindow" I found on the MS site) all to no avail.  

Does anyone know how to handle this so that the form closes without saving
and without prompting the user.  The program is running on Access 2007 and
Runtime 2007.  (Symptom occurs on both).

Alternatively, the overall goal that I'm trying to accomplish is put a blank
line in between specific groups in a continuous form.  The formatting I
mention is setting the background and foreground of all the controls to the
same color to fake the "blank" line for some close to empty lines I've got in
the TSQL Procedure.   If anyone has a nice way to make subforms insert blank
lines based on specific data in the query, I could probably use that and
forget the formatting.

Thanks for any help in advanced.
Tony Toews [MVP] - 30 Apr 2008 04:26 GMT
>Alternatively, the overall goal that I'm trying to accomplish is put a blank
>line in between specific groups in a continuous form.  The formatting I
[quoted text clipped - 3 lines]
>lines based on specific data in the query, I could probably use that and
>forget the formatting.

Create a sum query based on the original table/query such that only
groups are present in the query.  Now Union that query with the
original query/table sorting by that group.

Now the problem is to ensure that this new sum query fields are after
the original table/query data.

You can either
1) add a field on the original table/query with a 0 in it and add a
field in this new sum query with a 1 in it and sequence the Union
query accordingly
2) or create another field in the sum query with a bunch of 99999s in
it which is unioned to a field in the original table/query such that
it will always sort higher than the other records

Hoping this all makes sense.

Tony

Signature

Tony Toews, Microsoft Access MVP
  Please respond only in the newsgroups so that others can
read the entire thread of messages.
  Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
  Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.