Group:  Microsoft Access ยป microsoft.public.access
Thread: GoSub Errors

Geek News

GoSub Errors
roccogrand 12/31/2008 2:05:00 AM
Why does this Click event throw a "Return without GoSub" error in Access 12?


Private Sub cmdCountBusinesses_Click()
DoCmd.Requery

nRecords = DCount("*", "qryClassBusiness")
MsgBox "There are " & nRecords & " Business Class members.", vbOKOnly

End Sub


I created the routine in Access 12 and then moved it to another machine. I
then brought it back to the original machine and now it throws this error and
does not display the calculated results. Interestingly, the object library
references are the same in both the original database and the database
brought back to the original PC.

The only thing that I can think of is that the second PC does not have the
August and November hotfixes. Could that be the problem?
Re: GoSub Errors
"Arvin Meyer [MVP]" <arvinm[ at ]mvps.invalid> 12/31/2008 2:10:32 AM
What are you requerying?

If it's a form, use:

Me.Requery

a combo or list box:

Me.ComboName.Requery
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
news:1747C114-1698-4DF6-A10D-EFD5C4EB071A[ at ]microsoft.com...
[Quoted Text]
> Why does this Click event throw a "Return without GoSub" error in Access
> 12?
>
>
> Private Sub cmdCountBusinesses_Click()
> DoCmd.Requery
>
> nRecords = DCount("*", "qryClassBusiness")
> MsgBox "There are " & nRecords & " Business Class members.", vbOKOnly
>
> End Sub
>
>
> I created the routine in Access 12 and then moved it to another machine.
> I
> then brought it back to the original machine and now it throws this error
> and
> does not display the calculated results. Interestingly, the object
> library
> references are the same in both the original database and the database
> brought back to the original PC.
>
> The only thing that I can think of is that the second PC does not have the
> August and November hotfixes. Could that be the problem?


Re: GoSub Errors
roccogrand 12/31/2008 3:14:01 AM
Thanks Arvin.

That worked but why does the DoCmd work in the original database but not
after the roundtrip? Are there other gotchas like this?

Thanks again, David



"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> What are you requerying?
>
> If it's a form, use:
>
> Me.Requery
>
> a combo or list box:
>
> Me.ComboName.Requery
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
> "roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
> news:1747C114-1698-4DF6-A10D-EFD5C4EB071A[ at ]microsoft.com...
> > Why does this Click event throw a "Return without GoSub" error in Access
> > 12?
> >
> >
> > Private Sub cmdCountBusinesses_Click()
> > DoCmd.Requery
> >
> > nRecords = DCount("*", "qryClassBusiness")
> > MsgBox "There are " & nRecords & " Business Class members.", vbOKOnly
> >
> > End Sub
> >
> >
> > I created the routine in Access 12 and then moved it to another machine.
> > I
> > then brought it back to the original machine and now it throws this error
> > and
> > does not display the calculated results. Interestingly, the object
> > library
> > references are the same in both the original database and the database
> > brought back to the original PC.
> >
> > The only thing that I can think of is that the second PC does not have the
> > August and November hotfixes. Could that be the problem?
>
>
>
Re: GoSub Errors
"Arvin Meyer [MVP]" <arvinm[ at ]mvps.invalid> 12/31/2008 10:11:39 PM
Hi David,

To tell the truth, I've never seen a requery done with DoCmd. I've always
done it using either:

Forms!FormName.Requery

or:

Me.Requery
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
news:FBE59421-ECCD-475A-B201-2457543A204B[ at ]microsoft.com...
[Quoted Text]
> Thanks Arvin.
>
> That worked but why does the DoCmd work in the original database but not
> after the roundtrip? Are there other gotchas like this?
>
> Thanks again, David
>
>
>
> "Arvin Meyer [MVP]" wrote:
>
>> What are you requerying?
>>
>> If it's a form, use:
>>
>> Me.Requery
>>
>> a combo or list box:
>>
>> Me.ComboName.Requery
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>>
>> "roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
>> news:1747C114-1698-4DF6-A10D-EFD5C4EB071A[ at ]microsoft.com...
>> > Why does this Click event throw a "Return without GoSub" error in
>> > Access
>> > 12?
>> >
>> >
>> > Private Sub cmdCountBusinesses_Click()
>> > DoCmd.Requery
>> >
>> > nRecords = DCount("*", "qryClassBusiness")
>> > MsgBox "There are " & nRecords & " Business Class members.", vbOKOnly
>> >
>> > End Sub
>> >
>> >
>> > I created the routine in Access 12 and then moved it to another
>> > machine.
>> > I
>> > then brought it back to the original machine and now it throws this
>> > error
>> > and
>> > does not display the calculated results. Interestingly, the object
>> > library
>> > references are the same in both the original database and the database
>> > brought back to the original PC.
>> >
>> > The only thing that I can think of is that the second PC does not have
>> > the
>> > August and November hotfixes. Could that be the problem?
>>
>>
>>


Re: GoSub Errors
roccogrand 1/1/2009 1:38:04 AM
Thanks Arvin.

As long as it works, I am happy.

Have a good year!

David

"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> Hi David,
>
> To tell the truth, I've never seen a requery done with DoCmd. I've always
> done it using either:
>
> Forms!FormName.Requery
>
> or:
>
> Me.Requery
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
> "roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
> news:FBE59421-ECCD-475A-B201-2457543A204B[ at ]microsoft.com...
> > Thanks Arvin.
> >
> > That worked but why does the DoCmd work in the original database but not
> > after the roundtrip? Are there other gotchas like this?
> >
> > Thanks again, David
> >
> >
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> What are you requerying?
> >>
> >> If it's a form, use:
> >>
> >> Me.Requery
> >>
> >> a combo or list box:
> >>
> >> Me.ComboName.Requery
> >> --
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >>
> >> "roccogrand" <roccogrand[ at ]discussions.microsoft.com> wrote in message
> >> news:1747C114-1698-4DF6-A10D-EFD5C4EB071A[ at ]microsoft.com...
> >> > Why does this Click event throw a "Return without GoSub" error in
> >> > Access
> >> > 12?
> >> >
> >> >
> >> > Private Sub cmdCountBusinesses_Click()
> >> > DoCmd.Requery
> >> >
> >> > nRecords = DCount("*", "qryClassBusiness")
> >> > MsgBox "There are " & nRecords & " Business Class members.", vbOKOnly
> >> >
> >> > End Sub
> >> >
> >> >
> >> > I created the routine in Access 12 and then moved it to another
> >> > machine.
> >> > I
> >> > then brought it back to the original machine and now it throws this
> >> > error
> >> > and
> >> > does not display the calculated results. Interestingly, the object
> >> > library
> >> > references are the same in both the original database and the database
> >> > brought back to the original PC.
> >> >
> >> > The only thing that I can think of is that the second PC does not have
> >> > the
> >> > August and November hotfixes. Could that be the problem?
> >>
> >>
> >>
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net