438 - Object doesn't support this property or method

J

John Desselle

MS Access 2000 database created on W2K.
Upgraded box to MS Access 2003 and WinXP

User clicks button and is able to select file from network. The path of
this file is loaded into my database form. There are a couple of drop down
boxes to choose stuff and blanks for username and password.

Another button should populate a subform in datasheet view with all this
information and create a html link to file so that a FTP process can upload
the info into a web application with links to documents chosen.

I'm getting "438 - Object doesn't support this property or method" when the
'Add' button is clicked to populate the datasheet.

I've taken the 2000 database and converted into 2003, checked references,
neither helped out. There is error handling written in, but I can't even
make it fire off by leaving out some of the required info.

I'm wondering if someone could peek at this code for the 'Add' Button and
tell me if they find anything.
Thanks

Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click

If Me.cmbOffice = "" Or Me.txtFull_filename = "" Then
MsgBox "Please select file before save"
Exit Sub
End If
If Me.ftpuser = "" Or Me.ftppass = "" Then
MsgBox "Please enter Username and Password"
Exit Sub
End If
filefullname = Me.txtFull_filename
ftpuser = Me.ftpuser
ftppass = Me.ftppass

Dim stSQL As String
position = 1
short_filename = Me.txtFull_filename
Do While position > 0
position = InStr(1, short_filename, "\", vbTextCompare)
If position > 0 Then short_filename = Right(short_filename,
Len(short_filename) - position)
Loop

If Me.Draft = "" Or Me.Bill_Number > "" Or Me.Bill_Type > "" Then
FileName = Me.Bill_Type & Me.Bill_Number & Me.cmbOffice & Me.cmbType &
Me.cmbVersion & Year(Date) & Month(Date) & Day(Date) & Right(filefullname, 4)
Else
FileName = "Draft" & Me.Draft & Me.cmbOffice & Me.cmbType &
Me.cmbVersion & Year(Date) & Month(Date) & Day(Date) & Right(filefullname, 4)
End If



''''''''''''''do the ftp'''''''''''''
Me.ctlFTP.UserName = ftpuser
Me.ctlFTP.Password = ftppass
Me.ctlFTP.LocalFile = filefullname

Me.ctlFTP.RemoteFile = FileName
Me.ctlFTP.Binary = True
Me.ctlFTP.RemoteAddress = "intra"

' On Error Resume Next
Me.ctlFTP.Connect
Me.ctlFTP.RemoteDirectory = "/reports"
Me.ctlFTP.PutFile
Me.ctlFTP.Disconnect
' If Err <> 0 Then
' MsgBox "Unable to put file. Error code : " & Format$(Err.Number)
' End If


strShortDate = Format(Now(), "SHORT DATE")
Set con = Application.CurrentProject.Connection
stSQL = "insert into Agency_Files ( Agency_Code,
Legislation_id,Full_Filename,url_link, file_version, imp_type, upload_date )"
stSQL = stSQL & " values('" & Me.cmbOffice & "', " & Me.id & ",'" &
filefullname & "','http://intra.xxxxxx/xxxxxxxx/xxxxxxx//" & FileName & "',
'" & Me.cmbVersion & "', '" & Me.cmbType & "', '" & strShortDate & "')"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSQL, con, 1 ' 1 = adOpenKeyset
Set rs = Nothing
Set con = Nothing


Me.txtFull_filename = ""
Me.cmbOffice = ""
Me.cmbVersion = ""
Me.cmbType = ""
Me.ftpuser = ""
Me.ftppass = ""
Me.Agency_Files_subform.Requery





exit_cmdadd_click:
Exit Sub

Err_cmdAdd_Click:
MsgBox Err.Number & "-" & Err.Description
Resume exit_cmdadd_click

End Sub
 
H

hmadyson

When you click the button and you get the error and hit debug, do you see
which line is giving the error? If you cannot debug, please turn off the
error trapping for a moment by commenting out the On Error line. This will
give you (and me) a lot more info. From what I see, I would guess that the
error is due to the Dim statement which is below code. I believe that moving
that to the top of the procedure will help.

Please let me know if I can provide more assistance.
 
J

John Desselle

I commented out the OnError line and hit Debug...

Me.ctlFTP.UserName = ftpuser

is the line in question.

This form has Easy FTP included.
 
J

John Desselle

More info:

I created a new database and imported everything from the original. It ran
into a problem with the ActiveX Control (EzFTP) and said to check references.

Here's what is Available:
Visual Basic For Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

Missing is the Reference to the EzFTP control. I had it before, but it
isn't there now.
The EzFTP Control came with instructions (if you want to call them that)
that I don't know how to complete.

There is currently no flashy installation program, but all you need to do is:

1. Transfer EZFTP.OCX and WININET.DLL to your \Windows\System or
\Winnt\System32 folder
2. Make sure you overwrite any older version of WININET.DLL. Using versions
prior to the 5/24/96 version provided in the ZIP will cause GPFs when the
application ends.
3. Make sure you have the MFC/OLE DLLs on your system
4. Make sure MFC40.DLL is dated 10/6/95 or later
5. Register EZFTP.OCX with the command:

REGSVR32 EZFTP.OCX

If you don't have the MFC/OLE DLLs or don't have the latest versions, they
can be download from the COOL.STF homepage, http://www.coolstf.com.
 
J

John Desselle

Anyone have any ideas on this topic?

Thanks

John Desselle said:
More info:

I created a new database and imported everything from the original. It ran
into a problem with the ActiveX Control (EzFTP) and said to check references.

Here's what is Available:
Visual Basic For Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

Missing is the Reference to the EzFTP control. I had it before, but it
isn't there now.
The EzFTP Control came with instructions (if you want to call them that)
that I don't know how to complete.

There is currently no flashy installation program, but all you need to do is:

1. Transfer EZFTP.OCX and WININET.DLL to your \Windows\System or
\Winnt\System32 folder
2. Make sure you overwrite any older version of WININET.DLL. Using versions
prior to the 5/24/96 version provided in the ZIP will cause GPFs when the
application ends.
3. Make sure you have the MFC/OLE DLLs on your system
4. Make sure MFC40.DLL is dated 10/6/95 or later
5. Register EZFTP.OCX with the command:

REGSVR32 EZFTP.OCX

If you don't have the MFC/OLE DLLs or don't have the latest versions, they
can be download from the COOL.STF homepage, http://www.coolstf.com.
 

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