PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Closing Form causes a requery?

 
 
DawnTreader
Guest
Posts: n/a
 
      7th May 2010
Hello All

i have a main form that has a list box on it that uses a query to allow the
user to pick records to see on the main form. there are a bunch of combo
boxes and text boxes that the query uses as criteria to allow users to filter
the query. it was working fine, then i added a new filter box.

the filtering still works fine, but now when a user hits the exit button,
which causes a docmd.quit, it starts poping up parameter dialogs for each
text box that i use to put criteria in the query fields. it still exits, it
just pops up these boxes.

i took out the entire criteria and tried it and of course it fixes the
problem, but put the criteria back and it does it again.

i took the entire sql statement and put in in notepad temporarily, then
removed the criteria, saved, closed the application, right clicked and
compacted, then open the app and tried the exit, worked perfectly, no
dialogs. opened app, put the criteria back in compacted, opened the app
normally, exited and bang, dialogs for each criteria.

i have looked through my vba code on the form and there is nothing on the
exiting or closing of the form calling for a requery of the list box so i
dont understand why it is doing this. it has never done this before.

anyone have any idea as to why?

--
As always, any and all help appreciated!
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      8th May 2010
Well, I guess you either have a Requery in your code, somewhere, or you
don’t. Hit Alt+F11. Ctrl+F and Find What = Requery. Click Current Project
and click Next. Is there any kind of ‘Requery’ in there that you didn’t know
about?

If that doesn’t do it for ya, try Compact and Repair. It’s a bit different
b/w 2007 version and earlier versions. Check out how to do it for your
version. This may help:
http://office.microsoft.com/en-us/ac...874491033.aspx




--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"DawnTreader" wrote:

> Hello All
>
> i have a main form that has a list box on it that uses a query to allow the
> user to pick records to see on the main form. there are a bunch of combo
> boxes and text boxes that the query uses as criteria to allow users to filter
> the query. it was working fine, then i added a new filter box.
>
> the filtering still works fine, but now when a user hits the exit button,
> which causes a docmd.quit, it starts poping up parameter dialogs for each
> text box that i use to put criteria in the query fields. it still exits, it
> just pops up these boxes.
>
> i took out the entire criteria and tried it and of course it fixes the
> problem, but put the criteria back and it does it again.
>
> i took the entire sql statement and put in in notepad temporarily, then
> removed the criteria, saved, closed the application, right clicked and
> compacted, then open the app and tried the exit, worked perfectly, no
> dialogs. opened app, put the criteria back in compacted, opened the app
> normally, exited and bang, dialogs for each criteria.
>
> i have looked through my vba code on the form and there is nothing on the
> exiting or closing of the form calling for a requery of the list box so i
> dont understand why it is doing this. it has never done this before.
>
> anyone have any idea as to why?
>
> --
> As always, any and all help appreciated!

 
Reply With Quote
 
DawnTreader
Guest
Posts: n/a
 
      12th May 2010
hello Ryan

i have been all up and down this code. it is not something requerying. i
thought maybe the timing of some code would be the culprit so i moved it, but
that didnt fix it.

all i did was add one field to the filtering system and now the query that
is being filtered is requerying when the form unloads. i though i could put
in a new record source for the listbox and empty it before the form closes to
make this stop, but it didnt help.

this is a source of great frustration as it was 2 text boxes and some
additional sql in the query with a little VBA for initiating the filtering
mechanizm.
--
As always, any and all help appreciated!


"ryguy7272" wrote:

> Well, I guess you either have a Requery in your code, somewhere, or you
> don’t. Hit Alt+F11. Ctrl+F and Find What = Requery. Click Current Project
> and click Next. Is there any kind of ‘Requery’ in there that you didn’t know
> about?
>
> If that doesn’t do it for ya, try Compact and Repair. It’s a bit different
> b/w 2007 version and earlier versions. Check out how to do it for your
> version. This may help:
> http://office.microsoft.com/en-us/ac...874491033.aspx
>
>
>
>
> --
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
>
>
> "DawnTreader" wrote:
>
> > Hello All
> >
> > i have a main form that has a list box on it that uses a query to allow the
> > user to pick records to see on the main form. there are a bunch of combo
> > boxes and text boxes that the query uses as criteria to allow users to filter
> > the query. it was working fine, then i added a new filter box.
> >
> > the filtering still works fine, but now when a user hits the exit button,
> > which causes a docmd.quit, it starts poping up parameter dialogs for each
> > text box that i use to put criteria in the query fields. it still exits, it
> > just pops up these boxes.
> >
> > i took out the entire criteria and tried it and of course it fixes the
> > problem, but put the criteria back and it does it again.
> >
> > i took the entire sql statement and put in in notepad temporarily, then
> > removed the criteria, saved, closed the application, right clicked and
> > compacted, then open the app and tried the exit, worked perfectly, no
> > dialogs. opened app, put the criteria back in compacted, opened the app
> > normally, exited and bang, dialogs for each criteria.
> >
> > i have looked through my vba code on the form and there is nothing on the
> > exiting or closing of the form calling for a requery of the list box so i
> > dont understand why it is doing this. it has never done this before.
> >
> > anyone have any idea as to why?
> >
> > --
> > As always, any and all help appreciated!

 
Reply With Quote
 
DawnTreader
Guest
Posts: n/a
 
      12th May 2010
Well what do you know...

docmd.quit causes it to requery

DoCmd.RunCommand acCmdExit does not.

dont know why, but problem solved.


--
As always, any and all help appreciated!


"DawnTreader" wrote:

> hello Ryan
>
> i have been all up and down this code. it is not something requerying. i
> thought maybe the timing of some code would be the culprit so i moved it, but
> that didnt fix it.
>
> all i did was add one field to the filtering system and now the query that
> is being filtered is requerying when the form unloads. i though i could put
> in a new record source for the listbox and empty it before the form closes to
> make this stop, but it didnt help.
>
> this is a source of great frustration as it was 2 text boxes and some
> additional sql in the query with a little VBA for initiating the filtering
> mechanizm.
> --
> As always, any and all help appreciated!
>
>
> "ryguy7272" wrote:
>
> > Well, I guess you either have a Requery in your code, somewhere, or you
> > don’t. Hit Alt+F11. Ctrl+F and Find What = Requery. Click Current Project
> > and click Next. Is there any kind of ‘Requery’ in there that you didn’t know
> > about?
> >
> > If that doesn’t do it for ya, try Compact and Repair. It’s a bit different
> > b/w 2007 version and earlier versions. Check out how to do it for your
> > version. This may help:
> > http://office.microsoft.com/en-us/ac...874491033.aspx
> >
> >
> >
> >
> > --
> > Ryan---
> > If this information was helpful, please indicate this by clicking ''Yes''.
> >
> >
> > "DawnTreader" wrote:
> >
> > > Hello All
> > >
> > > i have a main form that has a list box on it that uses a query to allow the
> > > user to pick records to see on the main form. there are a bunch of combo
> > > boxes and text boxes that the query uses as criteria to allow users to filter
> > > the query. it was working fine, then i added a new filter box.
> > >
> > > the filtering still works fine, but now when a user hits the exit button,
> > > which causes a docmd.quit, it starts poping up parameter dialogs for each
> > > text box that i use to put criteria in the query fields. it still exits, it
> > > just pops up these boxes.
> > >
> > > i took out the entire criteria and tried it and of course it fixes the
> > > problem, but put the criteria back and it does it again.
> > >
> > > i took the entire sql statement and put in in notepad temporarily, then
> > > removed the criteria, saved, closed the application, right clicked and
> > > compacted, then open the app and tried the exit, worked perfectly, no
> > > dialogs. opened app, put the criteria back in compacted, opened the app
> > > normally, exited and bang, dialogs for each criteria.
> > >
> > > i have looked through my vba code on the form and there is nothing on the
> > > exiting or closing of the form calling for a requery of the list box so i
> > > dont understand why it is doing this. it has never done this before.
> > >
> > > anyone have any idea as to why?
> > >
> > > --
> > > As always, any and all help appreciated!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery issue : Application closes on form.requery.... =?Utf-8?B?c3VyeWE=?= Microsoft Access Form Coding 3 6th Nov 2006 08:58 PM
Requery the 1st requery result which displayed in form vincentt via AccessMonster.com Microsoft Access 2 31st Aug 2006 03:49 AM
Showing form , closing login form but not closing app, how Bob Microsoft VB .NET 3 21st Dec 2005 07:54 PM
Closing event in a MID Child form I don't know if the child form is closing or the main form is closing **Developer** Microsoft C# .NET 1 19th Oct 2005 04:51 PM
Multiple OutputTo (Called on Closing Form) Fails on Closing Database John Andrews Microsoft Access Macros 3 21st May 2004 08:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:44 AM.