GoSub Errors

R

roccogrand

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?
 
A

Arvin Meyer [MVP]

What are you requerying?

If it's a form, use:

Me.Requery

a combo or list box:

Me.ComboName.Requery
 
R

roccogrand

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top