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