gettting the aforementioned error 438....
when this code runs
Private Sub cmdLoadOLE_Click()
Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String
MyFolder = Me!SearchFolder <---------------------------------------- Getting 438 error on this line
' Get the search path.
MyPath = MyFolder & "\" & "*." & [SearchExtension]
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[OLEPath] = MyFolder & "\" & MyFile
[OLEFile].Class = [OLEClass]
[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [OLEPath]
[OLEFile].Action = acOLECreateEmbed
' Check for next OLE file in the folder.
MyFile = Dir
' Go to new record on form.
' For Access 95 only, use the following Line of code:
'DoCmd.DoMenuItem acFormBar, acEditMenu, 12, 4, acMenuVer70
' For Access 97 only, use the following line of code:
'DoCmd.RunCommand acCmdRecordsGoToNew
Loop
End Sub
access 97
when this code runs
Private Sub cmdLoadOLE_Click()
Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String
MyFolder = Me!SearchFolder <---------------------------------------- Getting 438 error on this line
' Get the search path.
MyPath = MyFolder & "\" & "*." & [SearchExtension]
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[OLEPath] = MyFolder & "\" & MyFile
[OLEFile].Class = [OLEClass]
[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [OLEPath]
[OLEFile].Action = acOLECreateEmbed
' Check for next OLE file in the folder.
MyFile = Dir
' Go to new record on form.
' For Access 95 only, use the following Line of code:
'DoCmd.DoMenuItem acFormBar, acEditMenu, 12, 4, acMenuVer70
' For Access 97 only, use the following line of code:
'DoCmd.RunCommand acCmdRecordsGoToNew
Loop
End Sub
access 97