Access 2003 Error 2749

M

Marc

How can I avoid the error
------------------------------------------------------------------------------------------------Run-time error '2749':

There isn't enough memory to complete the Automation object operation in the
OLE object.

------------------------------------------------------------------------------------------------




Here is the code
------------------------------------------------------------------------------------------------
Private Sub cmdLoadOLE_Click()

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String

MyFolder = Me.SearchFolder__
' Get the search path.
MyPath = MyFolder & "\" & "*.jpg"
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)

Do While Len(MyFile) <> 0

'[fldID] = CInt("4869")
[fldID] = CInt(Replace(MyFile, ".jpg", ""))
[fldOLE].Class = "MSPhotoEd.3"
[fldOLE].OLETypeAllowed = acOLEEmbedded
[fldOLE].SourceDoc = MyFolder & "\" & MyFile
[fldOLE].Action = acOLECreateEmbed
[fldOLE].Action = acOLEClose

' Check for next OLE file in the folder.
MyFile = Dir

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

Loop

End Sub

------------------------------------------------------------------------------------------------
 
E

Evi

I've spotted one thing (although it may not be the reason for the error)
The code says

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

But you haven't put an apostrophe in front of the DoCmd line so the code
will still try to use it.

Evi

Marc said:
How can I avoid the error?
--------------------------------------------------------------------------
----------------------Run-time error '2749':
There isn't enough memory to complete the Automation object operation in the
OLE object.

-------------------------------------------------------------------------- ----------------------




Here is the code:
-------------------------------------------------------------------------- ----------------------
Private Sub cmdLoadOLE_Click()

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String

MyFolder = Me.SearchFolder__
' Get the search path.
MyPath = MyFolder & "\" & "*.jpg"
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)

Do While Len(MyFile) <> 0

'[fldID] = CInt("4869")
[fldID] = CInt(Replace(MyFile, ".jpg", ""))
[fldOLE].Class = "MSPhotoEd.3"
[fldOLE].OLETypeAllowed = acOLEEmbedded
[fldOLE].SourceDoc = MyFolder & "\" & MyFile
[fldOLE].Action = acOLECreateEmbed
[fldOLE].Action = acOLEClose

' Check for next OLE file in the folder.
MyFile = Dir

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

Loop

End Sub

--------------------------------------------------------------------------
----------------------
 
B

box2003

The apostrophe is for commenting or remarking. In most cases, what follows
the ' is comment.

This is a comment:
'docmd.openquery "qryFirstRun", acViewNormal

In the above nothing happens.

This is a line of executable code:
docmd.openquery "qryFirstRun", acViewNormal

In the above the line of code opens and executes query qryFirstRun

Evi said:
I've spotted one thing (although it may not be the reason for the error)
The code says

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

But you haven't put an apostrophe in front of the DoCmd line so the code
will still try to use it.

Evi

Marc said:
How can I avoid the error?
--------------------------------------------------------------------------
----------------------Run-time error '2749':
There isn't enough memory to complete the Automation object operation in the
OLE object.

-------------------------------------------------------------------------- ----------------------




Here is the code:
-------------------------------------------------------------------------- ----------------------
Private Sub cmdLoadOLE_Click()

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String

MyFolder = Me.SearchFolder__
' Get the search path.
MyPath = MyFolder & "\" & "*.jpg"
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)

Do While Len(MyFile) <> 0

'[fldID] = CInt("4869")
[fldID] = CInt(Replace(MyFile, ".jpg", ""))
[fldOLE].Class = "MSPhotoEd.3"
[fldOLE].OLETypeAllowed = acOLEEmbedded
[fldOLE].SourceDoc = MyFolder & "\" & MyFile
[fldOLE].Action = acOLECreateEmbed
[fldOLE].Action = acOLEClose

' Check for next OLE file in the folder.
MyFile = Dir

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

Loop

End Sub

--------------------------------------------------------------------------
 
E

Evi

You seem to have misread my email.
I know what the purpose of the comment is. The problem is that the writer
has NOT commented out the DoCmd.RunCommand code although the comment above
it clearly states that this is code is for Acc97 only and the subject line
of the message makes it clear that the writer is using Acc2003
Evi

box2003 said:
The apostrophe is for commenting or remarking. In most cases, what follows
the ' is comment.

This is a comment:
'docmd.openquery "qryFirstRun", acViewNormal

In the above nothing happens.

This is a line of executable code:
docmd.openquery "qryFirstRun", acViewNormal

In the above the line of code opens and executes query qryFirstRun

Evi said:
I've spotted one thing (although it may not be the reason for the error)
The code says

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

But you haven't put an apostrophe in front of the DoCmd line so the code
will still try to use it.

Evi

Marc said:
How can I avoid the error?
--------------------------------------------------------------------------
----------------------Run-time error '2749':
There isn't enough memory to complete the Automation object operation
in
the
OLE object.
--------------------------------------------------------------------------
----------------------




Here is the code:
--------------------------------------------------------------------------
----------------------
Private Sub cmdLoadOLE_Click()

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String

MyFolder = Me.SearchFolder__
' Get the search path.
MyPath = MyFolder & "\" & "*.jpg"
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)

Do While Len(MyFile) <> 0

'[fldID] = CInt("4869")
[fldID] = CInt(Replace(MyFile, ".jpg", ""))
[fldOLE].Class = "MSPhotoEd.3"
[fldOLE].OLETypeAllowed = acOLEEmbedded
[fldOLE].SourceDoc = MyFolder & "\" & MyFile
[fldOLE].Action = acOLECreateEmbed
[fldOLE].Action = acOLEClose

' Check for next OLE file in the folder.
MyFile = Dir

' For Access 97 only, use the following line of code:
DoCmd.RunCommand acCmdRecordsGoToNew

Loop

End Sub
 

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