473,385 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Saving design changes

For a client who wants answers, but doesn't want to bother to learn Access,
I've built a cut-down query generator, where they can select fields and
criteria. I then compose the appropriate SQL SELECT statement and assign it
to a fixed query name. ( qryTemp.SQL= MySQLString)
qryTemp is the SourceObject for a subform on a form which I then open.
(Note that the query itself is the source object, not a form based
on it.)
So far, this works great!

My problem is that whenever I go to close this form (or even when it loses
focus), I get a messagebox asking if I want to save changes to the query.
If I choose "No", I get another one. (only 2, though)
I've thought that I could take care of this by saving the form before I
close it, but my attempts have all been rewarded with an error on the order
of "you can't do this now".

I don't think my tech-phobic clients will be pleased by this message.
Any ideas how I can avoid it?

- Turtle
BTW I'm working in A2K2, with A2K file format.
Nov 13 '05 #1
7 2343
MacDermott wrote:

You could try to close the query from the LostFocus event of the form,
including the acSaveNo argument with Docmd.Close.

Catch the "you cannot do that now" with an On Error Resume Next.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2
Close the query?
Like
DoCmd.Close acQuery, "tmpQuery", acSaveNo
I'll sure give it a try, but AFAIK, the query is open only as part of the
form.
Wouldn't that be a bit like trying to close a subform?

- Turtle

"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:cn**********@news2.solcon.nl...
MacDermott wrote:

You could try to close the query from the LostFocus event of the form,
including the acSaveNo argument with Docmd.Close.

Catch the "you cannot do that now" with an On Error Resume Next.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #3
MacDermott wrote:
Close the query?
Like
DoCmd.Close acQuery, "tmpQuery", acSaveNo
I'll sure give it a try, but AFAIK, the query is open only as part of the
form.
Wouldn't that be a bit like trying to close a subform?


If you did a docmd.openquery, no, definately not: the query is an
independent object. If you have it otherwise, let me know, I have a
place to apply that.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #4
Why not just save the SQL as text in a table? Unless their PCs are really
slow, the overhead for compiling the query is negligible. Then call the
query in code.
Darryl Kerkeslager

"MacDermott" <ma********@nospam.com> wrote:
My problem is that whenever I go to close this form (or even when it loses
focus), I get a messagebox asking if I want to save changes to the query.
If I choose "No", I get another one. (only 2, though)
I've thought that I could take care of this by saving the form before I close it, but my attempts have all been rewarded with an error on the order of "you can't do this now".

I don't think my tech-phobic clients will be pleased by this message.
Any ideas how I can avoid it?

Nov 13 '05 #5
I'm not using DoCmd.OpenQuery to display the recordset.

The query is embedded as a subform in a form, so that I can have a header
section with a variety of buttons and descriptive text. (This is not a full
subform in datasheet view; the SourceObject for the subform control reads
Query:qryTemp.)

I open this form using DoCmd.OpenForm.

More ideas?
- Turtle

"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:cn**********@news2.solcon.nl...
MacDermott wrote:
Close the query?
Like
DoCmd.Close acQuery, "tmpQuery", acSaveNo
I'll sure give it a try, but AFAIK, the query is open only as part of the form.
Wouldn't that be a bit like trying to close a subform?


If you did a docmd.openquery, no, definately not: the query is an
independent object. If you have it otherwise, let me know, I have a
place to apply that.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #6
Thanks for your thoughts.

I take care of saving the SQL elsewhere.
The issue is that I don't want to just call the query in code;
I want to embed it in a form.

- Turtle
"Darryl Kerkeslager" <Ke*********@comcast.net> wrote in message
news:ro********************@comcast.com...
Why not just save the SQL as text in a table? Unless their PCs are really
slow, the overhead for compiling the query is negligible. Then call the
query in code.
Darryl Kerkeslager

"MacDermott" <ma********@nospam.com> wrote:
My problem is that whenever I go to close this form (or even when it loses focus), I get a messagebox asking if I want to save changes to the query. If I choose "No", I get another one. (only 2, though)
I've thought that I could take care of this by saving the form
before I
close it, but my attempts have all been rewarded with an error on the

order
of "you can't do this now".

I don't think my tech-phobic clients will be pleased by this message.
Any ideas how I can avoid it?


Nov 13 '05 #7
MacDermott wrote:
I'm not using DoCmd.OpenQuery to display the recordset.

The query is embedded as a subform in a form, so that I can have a header
section with a variety of buttons and descriptive text. (This is not a full
subform in datasheet view; the SourceObject for the subform control reads
Query:qryTemp.)

I open this form using DoCmd.OpenForm.

More ideas?


Yup, not yet out of ammo.

Now that I read your question carefully :-) I understand my previous
advice is a blunder. So you have this query as an open object. Do you
assign the SQL before the object opens? I think you say so. What if you
*do* save changes on form.close? so appending acSaveYes. Or maybe acSaveNo.

If it won't solve the popping up of the message, try runcommand.save
before you close.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
(access 2002) Anyone have any suggestions as to what may be causing access to not save form changes after I "tell" it to, exit database, then re-open later to discover the changes had not been...
4
by: wayne dooley | last post by:
This should be easy. I have 2 tables - CUST and SUBS, which have a 1 to many relationship. I created a form to show fields from CUST and a subform to show those in SUBS. The 2 tables are related...
2
by: manning_news | last post by:
Has anyone had a problem with Access 2003 not saving their coding? I've been using 2003 for a couple of months now and just this week noticed that some coding I'd done for a database was not there...
11
by: kaosyeti | last post by:
i have a form that records 9 fields into a table. on that form i have a 'done' button to close the form. right now, if the form is fully filled in, but you don't press 'enter' before you click...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
3
by: Steve Long | last post by:
Hello. Can anyone tell me the proper way to save the properties of a user control between design time and run time? So, I've got this user control with the following properties: BarColor1...
4
by: ARC | last post by:
Hello all, I didn't use to have this problem in Access 97, but in 2007 (and maybe other versions of access after 97), if you have a form that has a subform, and you click the close button, you...
2
by: Matt | last post by:
I'm new to C#, so this really easy to answer for anyone that is adept at this... I'm having trouble saving data from my text boxes on a user form to my SQL database. Everything works fine while...
27
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.