Form button code no longer working

  • Thread starter Thread starter Christine
  • Start date Start date
C

Christine

Hi guys,

I have a situation where a button in my Access database no longer works. It
worked fine in Access 2003, but not in Access 2007.

The button works like this - a query is run to get a table of results and a
form pops up. The button is on this form. Clicking the button used to give
the user a choice of formats to export the form to. When the button is
clicked on, the Output To dialog box appears, but it doesn't matter which
format I pick, I get this error message:

The Microsoft Office Access database engine could not find the object
"ExportPotentialWords". Make surethe object exists and that you spell its
name and the path correctly.

The code behind the button is:

Private Sub Exporto_Click()
On Error GoTo Err_Exporto_Click

Dim stDocName As String

stDocName = "GetPotentialNPTs"
DoCmd.OutputTo acQuery, stDocName

Exit_Exporto_Click:
Exit Sub

Err_Exporto_Click:
MsgBox Err.Description
Resume Exit_Exporto_Click

End Sub

How can I get the button working again?
 
"ExportPotentiolWords" sounds like its a field or query that is supposed to
be there but ins't being picked up by access. I don't have any real
experience with '07, but I I would start by verifying that this object does
exist and is named correctly.

Another common error that tends to pop up when going from one format to
another is references that were set in your old db that might have not been
set in this one. It doesn't sound like this is the case here, but it might
be worth checking out.

--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
Hi Jack,

I think you might be right. I have another button that exports query
results, and I just realized that it is working fine. Hopefully I can find
where the missing link is.

Thanks!
Christine
 
Back
Top