Close Form/Subform without Saving Changes

T

TulsaPilot

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.
 
T

Tony Toews [MVP]

TulsaPilot said:
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.

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

--
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/
 

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