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. 7 2368
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
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.*********@he uvelqop.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
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
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********@nos pam.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?
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.*********@he uvelqop.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
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*********@co mcast.net> wrote in message
news:ro******** ************@co mcast.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********@nos pam.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?
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 saved (or somehow
reverted). BUT, new form module code is saved.
Example: created txtTitle control on form. Create AfterUpdate event
code for txtTitle. Save form. Close database. Later...Open database,
open form, txtTitle not there but its event...
|
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 on SUBSNO, and the data
source for each is the table (not a query). It behaves wonderfully, except
I can't seem to change the layout of the subform in design view. I make
changes and can see them in design view but in form view it reverts back...
|
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 anymore.
I reentered it and didn't have any problems for a couple of days.
Today I entered some coding, saved it, opened another database, and
when I opened my original database again, the coding I had entered was
missing.
Access 2000 always...
|
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 'done', then it closes the form
without saving the record. can i change this? thanks.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200511/1
|
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 at the moment
for queries but for datasheet forms I find that it automatically saves
column positions and widths without prompting to save changes.
I should mention i am using Access 2000
| |
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
BarColor2
I can access these properties in the property browser and change the colors.
But how to I have those changes persist between design time and run time for
|
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 always get the following dialog:
"Save changes to the following objects?"
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
|
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 in debug mode, the data is saved and
reflcted like it shoul be, but once I exit debug mode, all the changes are
lost when I reopen the app in debug mode again?
I saw the answer to this problem in a video but cannot find the video again?
I tried...
|
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 test the time
zone offset on a variety of dates to see if it changes. Based on
that, I developed the following checkDST() function which, as far as I
can tell, should be sufficient.
It checks either the date passed to it or the current date with...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |