Invalid Procedure Call (1 Viewer)

kkvan

New member
Local time
Today, 04:01
Joined
Oct 27, 2017
Messages
3
I've been running the same query in Access every day for months but then today when I tried to export my text file I got the error message "Invalid Procedure Call". Nothing in the query has changed so I'm guessing it was an issue with my data? I can't post the data here because it's private but is there a common issue that causes this error? I'm not well versed in Access so any help in the right direction would be great!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:01
Joined
May 7, 2009
Messages
19,247
Check the text that you are importing and compare it with the others. Are there missing columns, additional columns, datatype changed.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:01
Joined
Feb 28, 2001
Messages
27,217
Find the dialog for Windows Update. On the complex dialog box for that update, there should be an option to show you the update history. Look at that to see the dates. It is a simple test and if you HAVE had a recent update, it is possible that a library changed. Every now and then I see an Office-related update on my systems.

If you HAVE had a recent update, then your next step would be to go into a Module and look at Tools >> References to see if any reference is broken (or more likely, "missing.") If so, there is your "Invalid Procedure Call." Fix the reference and you should be OK.

If that isn't the problem, you are still looking for a recent change. I was just suggesting the most likely recent change.
 

kkvan

New member
Local time
Today, 04:01
Joined
Oct 27, 2017
Messages
3
Thanks everyone! I did try rebooting but that didn't work, I'm not sure what compacting is. Could you explain that?

I did check references and nothing was missing, and I did check the data and nothing had changed. I'm really at a loss here!

Thanks again for your help!
 

Mark_

Longboard on the internet
Local time
Today, 04:01
Joined
Sep 12, 2017
Messages
2,111
Thanks everyone! I did try rebooting but that didn't work, I'm not sure what compacting is. Could you explain that?

I did check references and nothing was missing, and I did check the data and nothing had changed. I'm really at a loss here!

Thanks again for your help!

Database Tools -> Compact and Repair Database
 

kkvan

New member
Local time
Today, 04:01
Joined
Oct 27, 2017
Messages
3
Compacting didn't work either :(

How would I know if a reference is broken? And how would I go about fixing that? Thanks!
 

AWAISKAZMI

Registered User.
Local time
Today, 15:01
Joined
Oct 28, 2017
Messages
12
Hello every one can anybody help me i have an error while executing a button "Object Required"

Private Sub Command12_Click()
Dim cn As ADODB.Connection
Set rs = New ADODB.Recordset
On Error GoTo errorhandler
Set cn = New ADODB.Connection

Set rs = New ADODB.Recordset
rs.ActiveConnection = CurrentProject.Connection
rs.Open ("select * from MySelectedObservations")

Dim objWord As Word.Application
Dim pathgetter As String
Dim doc As Word.Document
Dim WordHeaderFooter As HeaderFooter
Dim filepath As String
Set objWord = CreateObject("Word.Application")

pathgetter = DLookup("Word_Path_Field", "WORD_PATH_TBL", "Serial = 1")
filepath = "" & pathgetter & "\Observations " & Format(Now(), "dd-mm-yyyy") & ".docx"

With objWord
.Visible = True

Set doc = .Documents.Open(filepath)
'doc.SaveAs CurrentProject.Path & "\TestDoc.doc"
End With

With objWord.Selection

'.Font.Name = "Times New Roman"
'.Font.Size = 10
'.Font.TextColor = vbBlack
'.Font.Bold = True
'.Font.Underline = wdUnderlineNone
' .TypeText ProcessList.Value
' .TypeParagraph

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = True
.Font.Underline = wdUnderlineSingle
'.Font.Bold = True
' .TypeText "( "
' .TypeText controllist.Value
' .TypeText " ):"

.TypeText Observation_Heading.Value
.TypeText ":"
.TypeParagraph

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = False
.Font.Underline = wdUnderlineNone
.TypeText Observation_Details.Value
.TypeParagraph
.TypeParagraph

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = True
.Font.Underline = wdUnderlineNone

.TypeText "Risk Implication: "

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = False
.Font.Underline = wdUnderlineNone

.TypeText Risk_Implication.Value
.TypeParagraph

.Font.Name = "Times new Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = True
.Font.Underline = wdUnderlineNone

.TypeText "Risk Category: "
.TypeParagraph

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = False
.Font.Underline = wdUnderlineNone

.TypeText Risk_Category.Value
.TypeParagraph

.Font.Name = "Times New Roman"
.Font.Size = 10
.Font.TextColor = vbBlack
.Font.Bold = True
.Font.Underline = wdUnderlineNone

.TypeText "Branch Remarks: "
.TypeParagraph
.TypeParagraph

'Add header and footer

' ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = List57.Value
' ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "Auditor: Iftikhar Ahmad"
End With

doc.Save
doc.Activate

errorhandler:
MsgBox Err.Description

End Sub


Please help me what is missing
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Today, 07:01
Joined
Jan 23, 2006
Messages
15,383
awaiskazmi,

Why did you add your post to this thread? You could create a thread of your own with a new topic.
What exactly does your post have to do with Access?
What are you trying to accomplish -in plain, simple English?
 

Mark_

Longboard on the internet
Local time
Today, 04:01
Joined
Sep 12, 2017
Messages
2,111
Besides thread hijacking, I've noted almost immediately that the department of redundancy department has been at work.

Code:
Set rs = New ADODB.Recordset

is repeated twice without RS being declared. There is no
Code:
Dim rs
creating rs prior to it being set.
 

Users who are viewing this thread

Top Bottom