
February 18th, 2006, 07:15 PM
| | | pause "on current"
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 |

February 18th, 2006, 11:05 PM
| | | Re: pause "on current"
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" <texson552000@yahoo.com> wrote in message
news:LeKJf.27778$7y1.19350@tornado.texas.rr.com...[color=blue]
>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
>
>[/color] | 
February 20th, 2006, 06:45 PM
| | | Re: pause "on current"
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" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
news:xY-dnbTaUN7fOWreRVn-rg@comcast.com...[color=blue]
> 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" <texson552000@yahoo.com> wrote in message
> news:LeKJf.27778$7y1.19350@tornado.texas.rr.com...[color=green]
> >I have a button on a form (form A) that opens another form. The form[/color][/color]
that[color=blue][color=green]
> > opens (form B) has a listbox that is populated with a call to a[/color][/color]
function[color=blue][color=green]
> > 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[/color][/color]
A.[color=blue][color=green]
> >
> > When Form B first opens, an error comes up that a field can not be[/color][/color]
found.[color=blue][color=green]
> > Once the form opens, advancing the records fires the "on current" and[/color][/color]
the[color=blue][color=green]
> > listbox fills as it should.
> >
> > It appears that the on current fires before the data is loaded in the[/color][/color]
form[color=blue][color=green]
> > on the initial opening??? Is there a way to make sure the data is in[/color][/color]
the[color=blue][color=green]
> > form before the on current fires, and still not list a query as the data
> > source?
> >
> > Thanks
> >
> >[/color]
>
>[/color] | 
February 21st, 2006, 03:35 AM
| | | Re: pause "on current"
Post the code you're using in the Current procedure.
--
Ken Snell
<MS ACCESS MVP>
"Doc Holiday" <texson552000@yahoo.com> wrote in message
news:lZnKf.28377$7y1.9502@tornado.texas.rr.com...[color=blue]
>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" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
> news:xY-dnbTaUN7fOWreRVn-rg@comcast.com...[color=green]
>> 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" <texson552000@yahoo.com> wrote in message
>> news:LeKJf.27778$7y1.19350@tornado.texas.rr.com...[color=darkred]
>> >I have a button on a form (form A) that opens another form. The form[/color][/color]
> that[color=green][color=darkred]
>> > opens (form B) has a listbox that is populated with a call to a[/color][/color]
> function[color=green][color=darkred]
>> > 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[/color][/color]
> A.[color=green][color=darkred]
>> >
>> > When Form B first opens, an error comes up that a field can not be[/color][/color]
> found.[color=green][color=darkred]
>> > Once the form opens, advancing the records fires the "on current" and[/color][/color]
> the[color=green][color=darkred]
>> > listbox fills as it should.
>> >
>> > It appears that the on current fires before the data is loaded in the[/color][/color]
> form[color=green][color=darkred]
>> > on the initial opening??? Is there a way to make sure the data is in[/color][/color]
> the[color=green][color=darkred]
>> > form before the on current fires, and still not list a query as the
>> > data
>> > source?
>> >
>> > Thanks
>> >
>> >[/color]
>>
>>[/color]
>
>[/color] | | Thread Tools | Search 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 HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,414 network members.
|