467,212 Members | 1,071 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,212 developers. It's quick & easy.

pause "on current"

RR
I have a button on a form (form A) that opens another form. The form that
opens (form B) has a listbox that is populated with a call to a function in
the "on current" event.
When form B with the listbox has a query listed as the data source, it works
fine.
In this case, the button on form A sets the record source for form B to one
of several queries, depending on what is selected in a combobox on form A.

When Form B first opens, an error comes up that a field can not be found.
Once the form opens, advancing the records fires the "on current" and the
listbox fills as it should.

It appears that the on current fires before the data is loaded in the form
on the initial opening??? Is there a way to make sure the data is in the
form before the on current fires, and still not list a query as the data
source?

Thanks
Feb 18 '06 #1
  • viewed: 2304
Share:
3 Replies
The current event will occur when a form opens; you cannot cancel it nor
stop it. In your situation, why not just trap for the error and exit the
Current sub if it occurs?

--

Ken Snell
<MS ACCESS MVP>

"RR" <te**********@yahoo.com> wrote in message
news:Le*******************@tornado.texas.rr.com...
I have a button on a form (form A) that opens another form. The form that
opens (form B) has a listbox that is populated with a call to a function
in
the "on current" event.
When form B with the listbox has a query listed as the data source, it
works
fine.
In this case, the button on form A sets the record source for form B to
one
of several queries, depending on what is selected in a combobox on form A.

When Form B first opens, an error comes up that a field can not be found.
Once the form opens, advancing the records fires the "on current" and the
listbox fills as it should.

It appears that the on current fires before the data is loaded in the form
on the initial opening??? Is there a way to make sure the data is in the
form before the on current fires, and still not list a query as the data
source?

Thanks

Feb 18 '06 #2
I have tried trapping error 2424 in the "on open" in the "on current" and in
the "on click" of the button that opens the form, and the error still
apears.

Is there a better way to handle the data to stop this error, short of having
several identical forms with each having its own query listed?
"Ken Snell" <kt***********@ncoomcastt.renaetl> wrote in message
news:xY********************@comcast.com...
The current event will occur when a form opens; you cannot cancel it nor
stop it. In your situation, why not just trap for the error and exit the
Current sub if it occurs?

--

Ken Snell
<MS ACCESS MVP>

"RR" <te**********@yahoo.com> wrote in message
news:Le*******************@tornado.texas.rr.com...
I have a button on a form (form A) that opens another form. The form that opens (form B) has a listbox that is populated with a call to a function in
the "on current" event.
When form B with the listbox has a query listed as the data source, it
works
fine.
In this case, the button on form A sets the record source for form B to
one
of several queries, depending on what is selected in a combobox on form A.
When Form B first opens, an error comes up that a field can not be found. Once the form opens, advancing the records fires the "on current" and the listbox fills as it should.

It appears that the on current fires before the data is loaded in the form on the initial opening??? Is there a way to make sure the data is in the form before the on current fires, and still not list a query as the data
source?

Thanks


Feb 20 '06 #3
Post the code you're using in the Current procedure.

--

Ken Snell
<MS ACCESS MVP>

"Doc Holiday" <te**********@yahoo.com> wrote in message
news:lZ******************@tornado.texas.rr.com...
I have tried trapping error 2424 in the "on open" in the "on current" and
in
the "on click" of the button that opens the form, and the error still
apears.

Is there a better way to handle the data to stop this error, short of
having
several identical forms with each having its own query listed?
"Ken Snell" <kt***********@ncoomcastt.renaetl> wrote in message
news:xY********************@comcast.com...
The current event will occur when a form opens; you cannot cancel it nor
stop it. In your situation, why not just trap for the error and exit the
Current sub if it occurs?

--

Ken Snell
<MS ACCESS MVP>

"RR" <te**********@yahoo.com> wrote in message
news:Le*******************@tornado.texas.rr.com...
>I have a button on a form (form A) that opens another form. The form that > opens (form B) has a listbox that is populated with a call to a function > in
> the "on current" event.
> When form B with the listbox has a query listed as the data source, it
> works
> fine.
> In this case, the button on form A sets the record source for form B
> to
> one
> of several queries, depending on what is selected in a combobox on form A. >
> When Form B first opens, an error comes up that a field can not be found. > Once the form opens, advancing the records fires the "on current" and the > listbox fills as it should.
>
> It appears that the on current fires before the data is loaded in the form > on the initial opening??? Is there a way to make sure the data is in the > form before the on current fires, and still not list a query as the
> data
> source?
>
> Thanks
>
>



Feb 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Paul D.Smith | last post: by
11 posts views Thread by David | last post: by
4 posts views Thread by Davids | last post: by
3 posts views Thread by JimM | last post: by
1 post views Thread by =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= | last post: by
9 posts views Thread by Giampaolo Rodola' | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.