Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error 438 object doesnt support this property or method

Status
Not open for further replies.

Bobnz

IS-IT--Management
Aug 19, 2002
116
NZ
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
 
Is the cmdLoadOLE command button located in the same form as the SearchFolder control ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the reply, yes it is
 
So, why not have the same convention as for other controls in your sub ?
MyFolder = [SearchFolder]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top