Error: Object doesn't support property or method

Hi all, I am trying to basically set the value of an option box through simple VBA, and I just can't get it to work, I receive Run-time error '438': Object doesn't support property or method. Here's the code:

	Public Sub ProjectViewCmd(ID As Long, Stat As String)
    Dim i As Integer
    Dim MyBox As String
    'if it is a project lead
    If Stat = "Active Lead" Or Stat = "Dead Lead" Then
        DoCmd.OpenForm "Project Leads", acNormal
        If Stat = "Dead Lead" Then
            Forms![Project Leads].Controls(BothOption).Value = True
            Forms![Project Leads].FilterOn = False
            Forms![Project Leads].Controls(ActiveOption).Value = False
            Forms![Project Leads].Controls(DeadOption).Value = False
        End If
        DoCmd.SearchForRecord acForm, "Project Leads", acFirst, "[Project ID]=" & ID
        'if it belongs in the project list form (i.e. not a lead)
            DoCmd.OpenForm "Project List", acNormal
            For i = 0 To 4
                MyBox = "Check" & CStr(i)
                If Forms![Project List].Controls(MyBox).Tag = Stat Then
                    Forms![Project List].Controls(MyBox).Value = True
                End If
            Next i
    End If

End Sub

The problem lines are
Forms![Project Leads].Controls(BothOption).Value = True
Forms![Project Leads].FilterOn = False
Forms![Project Leads].Controls(ActiveOption).Value = False
Forms![Project Leads].Controls(DeadOption).Value = False

Basically, depending on the status of a project (Active Lead, Dead Lead, etc) a button needs to open the correct form to view that project. However by default the forms are filtered and have buttons to adjust said filters. When I open the forms, I need to change the filters in order to have the selected project present in the recordset. My issue comes up when trying to simply set the option box back to false

Post your answer or comment

comments powered by Disqus
When I try to open an Access 2003 MDB file on our server, I receive a Microsoft Access Error Message 438: Object doesn't support property or method. I've tried updating and installing Microsoft updates. It didn't solve the problem. I then tried reinstalling Access 2003 and all of the updates. Still get the same error message. Anyone have any idea what I can do?

I have a database with a login form. After distributing the FE (incl. Access Runtime 2007 which is installed automatically) on 5 pc's everything was working, except for one PC. After clicking on the OK button in the login form it showed the error message: "Object doesn't support property or method". The PC is using XP prof SP3.

There used to be a trail version of Access 2007 installed on this PC, after i deleted it, it still didn't work. I've reinstalled the trail and used the original db on USB stick (the BE is on server). It still showed the same error.

I've checked the liberary (reference) settings and they were the same as on my pc, so this shouldn't be the problem.

On all the other PC's the code is working, so I thought there's no need to include the coding. (this should be correct).

You have any thoughts?

Thanks in advance!

Long story short, my DB was working fine until I exported a new form from another DB (same DB, just another file) into my current DB and replaced it. Now when I click a record to open it I receive the error "Object doesn't support this property or method"

how can i fix this??

the vba opens and this code seems to be a problem:

    Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load")  1 Then
            If varOpenArgsRecord(2) = "NewSimple" Then
                Me.TabControl.Style = 2
                Me.TabControl.TabFixedHeight = 0
            End If
        End If
    End If

    Exit Sub

    Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load")
    Resume Form_Load_Exit
End Sub

I am getting an error: "Object doesn't support the property or method"

using the following very reliable code.
It errors on CDlg1.DialogTitle = "Select File in Folder"

The only difference now is I am using a Win 7 64bit. I added Comdlg32.ocx to the WOW64 folder and registered it. It is in the References OK.

Private Sub cmdBrowse_Click()
Dim fileflags As FileOpenConstants
Dim filefilter As String
Dim sPath As String

'Set the text in the dialog title bar
CDlg1.DialogTitle = "Select File in Folder"
'Set the default file name and filter
CDlg1.DefaultExt = "xls*"
CDlg1.InitDir = ""
CDlg1.filename = ""
filefilter = "*.xls"
CDlg1.Filter = filefilter
CDlg1.FilterIndex = 0
'Prompt to create the file if it does not exist
'and prompt to overwrite if the file exists
fileflags = cdlOFNCreatePrompt + cdlOFNOverwritePrompt
CDlg1.Flags = fileflags
'Show the Save As common dialog box
'Return the path and file name selected or
'Return an empty string if the user cancels the dialog
sPath = CDlg1.filename

If sPath "" Then
txtImportPath = GetFolder(sPath)
End If
End Sub

Hello everyone, I have an old database in my group that has been handed down. It was originally created with 2003 and I'm getting an error "Object doesn't support this property method" when I select a button to search for a csv or xls file to import.

Does anyone know the solution or have any suggestions? I'm okay for a business person in vba but definitely not at the super user level.

If Me!XLSImport Then
SFileName = OpenFile.("Find Cost Detail Excel Spreadsheet", "xls")
' MsgBox "Only Excel files are importing at this time."
' Exit Sub
SFileName = BrowseFilename("Find Comma Seperated Value file", "csv")
End If



Hello All,

I am trying to get this to work. Basically, Im trying to copy the current records with the records of the subform and paste them in a new record.

I keep getting this error message "object doesn't support this property or method" It doesn't tell me where the error is or nothing???

What am I doing wrong?

Here is a simplified copy of the code.

	Dim dbs As Database, Rst As Recordset
        Dim SRst As Recordset

        Dim scompany As String
        Dim saddress As String

'Subform fields

Dim sSequenceNumber As Long
Dim sSequenceDescription As String

On Error GoTo Err_btnDuplicate_Click

Set dbs = CurrentDb
Set Rst = Me.RecordsetClone
Set SRst = Me.RoutingSubform.Form.RecordsetClone

scompany = "" & Me!company
saddress = "" & Me!Address

'Subform Fields

sSequenceNumber = "" & Me!RoutingSubform!SequenceNumber
sSequenceDescription = "" & Me!RoutingSubform!SequenceDescription

 With Rst
              !company = scompany
              !Address = saddress

'Subform fields

With SRst
     !SequenceNumber = sSequenceNumber
     !SequenceDescription = sSequenceDescription

 .Update                     ' Save changes.
           .Move 0, .LastModified
        End With
        Me.Bookmark = Rst.Bookmark

        Exit Sub

        MsgBox Error$
        Resume Exit_btnduplicate_Click:
End With
End Sub

Dear Friends,

I'm getting below error while using MS Flex Grid

Run time error 438 object doesn't support this property or method.

I have registered "Microsoft FlexGrid Control 6.0 (SP3)" but still getting this error.

Below is the code I'm using:

'MS Flex Grid Control used to create the form/grid
Private Sub InitProc()
txtSearch.Value = ""
MSFG1.ColWidth(0) = 0
MSFG1.ColWidth(1) = 1500
MSFG1.ColAlignment(1) = 0
MSFG1.ColWidth(2) = 4500
MSFG1.ColAlignment(2) = 0
MSFG1.ColWidth(3) = 1500
MSFG1.TextMatrix(0, 1) = "User ID" 'Assign the value of "User ID" Field
MSFG1.TextMatrix(0, 2) = "User Name"
MSFG1.TextMatrix(0, 3) = "Status"
End Sub

OS: Windows XP
MS Access: 2003

Thanks in advance for the help.



I am facing the run time error '438': Object doesn't support this property or method. It works fine from last 15 days & at sudden by yesterday,gives me this error in all Treeview/Listview controls of M/S common controls 6.0 (SP2). Can anyone help me in this issue?

Thanks a lot in advance,

I get an object doesn't support this property or method error when I execute this code... The bold statement below is where the debugger focuses in on, all other code works. Any incite would be greatly appreciated. Thanks

Private Sub Form_Load()
DoCmd.OpenForm "frmDateOfHire", , , , , acHidden
DoCmd.OpenForm "frmSalary", , , , , acHidden
DoCmd.OpenForm "frmClient", , , , , acHidden
DoCmd.OpenForm "frmSupervisor", , , , , acHidden
DoCmd.OpenForm "frmProject", , , , , acHidden
DoCmd.OpenForm "frmPrimaryVendor", , , , , acHidden
DoCmd.OpenForm "frmContractEmployee", , , , , acHidden

End Sub

Private Sub Next_frmDateOfHire_Click()

'Calls the Date Of Hire form, and hides Employee form
Forms!frmDateOfHire.Visible = True
Me.Visible = False

End Sub

I get this msg when i try to run the code below:

Object doesn't support this property or method

The error is caused by the following line.
I got it straight from a book so it should work. It doesn't seem to like me using Find:
Me.Recordset.Find "LastName = " & strName, Start:=1

Private Sub cmdFind_Click()

Dim strName As String
Dim varBookmark As Variant
varBookmark = Me.Recordset.Bookmark
strName = InputBox("Enter Surname")

Me.Recordset.Find "LastName = " & strName, Start:=1
If Me.Recordset.EOF Then
MsgBox "Surname " & strName & " Not Found!!"
Me.Recordset.Bookmark = varBookmark
End If
End Sub

Good day all!

Very simple conditions on open:

If Forms!frmLabsBuildFieldExamCards!tblLabsSignatory_ ID = 1 Then
Me.ImageMukhand = True
'Me.LabelMukhand = True
'Me.ImageKhaled = False
'Me.LabelKhaled = False
End If

I have some names and images of signatures that have to be either displayed or hidden depending on which signatory is selected.

However - the debug gives me "Object doesn't support this property or method"

is there anyway I can get an image to hide?

I have two combo boxes in my form, One is called as CompanyID, another ZoneID.
On event LostFoucus wiht CompanyID combo box I write VB code like this :

Private Sub Company_ID_LostFocus()

Me!ZoneID.RowSource = "SELECT [ZoneID] FROM [device]"

With Me!ZoneID
.RowSource = "SELECT ZoneID FROM deveice"
.RowSourceType = "Table/Query"
.ListRows = 5
End With

End Sub

But whenever CompanyID combo box lost focus a err message box shows up
on screen it say Run-time error '438' : Object doesn't support this property
or method.

Who can help me this ?

Thanks in advance !!!


[This message has been edited by JSL (edited 12-13-2000).]

[This message has been edited by JSL (edited 12-13-2000).]


I've tryed to insert a row in an excel sheet that I filled through an Access Table. Everything is ok with it, but when I try to use the generated code after recording a row insertion in excel, I get the following message:

Object doesn't support property or method

My code is the following:

    appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Where appExcel is my Excel Object declared as:

	Dim appExcel As Object
Set appExcel = CreateObject("Excel.Application")

When debbuging the error is in the .Insert row even if I comment the shifting part and so.

Any clue about how to get the code to insert 2 rows and paste in them other row's content?

I'd appreciate whatever you can suggest. Thanks in advance.


Hi All,

I'm sure this issue has come up elsewhere on the forum, but I can't find a solution...any help would be most appreciated.

Overview is this - I have a form showing records of company info and a subform where the user can enter an account number associated with that company.
The main form "frmCompanyEntry" has a button "AddNewAccount" that on the button's "On Click" event -
1. makes visible the subform "subfrmAccountAdd1"
2. starts a new record in the underlying table "tblAccounts"
3. sets the CompanyID field of "tblAccounts" to match the CompanyID field of the current record on the parent form from the table "tblCompany"
4. moves the focus to the AccountNumber field (the only visible field on the subform)
There is a button next to the AccountNumber field to save the record, move the focus off the subform and set the form as not visible.

OK - so everything seems to be working, but when the main form's "AddNewAccount" button is "clicked", I get a warning saying "doesn't support this property or method". I can click it away and the subform works fine, but I can't get rid of the warning.....
here is the code in the main form:

Private Sub AddNewAccount_Click()
On Error GoTo Err_AddNewAccount_Click
    Dim stDocName As String
    Dim AddCompID As Integer
    AddCompID = Me![CompanyID]
    stDocName = "subfrmAccountAdd1"
    Forms!frmCompanyEntry!subfrmAccountAdd1.Visible = True
    DoCmd.GoToRecord , , acNewRec
    Me.subfrmAccountAdd1.[CompanyID] = AddCompID
    Exit Sub
    MsgBox Err.Description
    Resume Exit_AddNewAccount_Click
End Sub

and here is the only code in the subform (to save record, move focus and set visibility to false

Private Sub SaveNewAccount_Click()
On Error GoTo Err_SaveNewAccount_Click
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Forms!frmCompanyEntry!subfrmAccountAdd1.Visible = False
    Exit Sub
    MsgBox Err.Description
    Resume Exit_SaveNewAccount_Click
End Sub

I am very much a beginner at access so any advice would be helpful

Thanks in advance.

I developed a software using MS Access 2003. I have imported a new progress bar control and used it. It was working properly. After more than two years, I back to this software and tried to run it on another computer. A problem is arise now giving a message "the object doesn't support this property or method" when processing the instruction progressbar1.min=0. This is happening despite that I added the ocx file ccrppr6.ocx into the C:/windows/system32.


i am trying to open and view Peter Hibbs' Appointments demo database where he uses the flex grid control. I have copied the necessary firl into my c:/windows/system32 folder and have had a successful registration of the file.

When i open the database and the first screen appears I get the error message " Object doesn't support this property or method"

I am using ms access 2007 on windows 7 32 bit computer. Any help be much appreciated as I would love to see what this control can do to maybe incorporate into my simulator bookings database



Hello, I apologize if this is a repeat of one of the many threads there are on the error 'object can't support this property or method'- but nothing that I found seems to pertain to my problem and I am really becoming frustrated.
I am taking some data from access queries and pasting them in an excel workbook, wb. Then, in each sheet, at the bottom of the pasted data, I am inserting a comments/footnotes section. These comments are pasted from a recordset called rs_subtaskcomments. The recordset contains the fields Name and CommentsSet.
Each comment is preceded by a comments counter. Each row (name) corresponds to each value of comments counter and is pasted as
commentcounter & " " & rs_subtaskcomments.fields("CommentsSet").value line by line.
After each line is pasted, the code needs to do the following: find the name that corresponds to the field 'Name' in the current record, and insert the commentcounter value as a superscript at the end of that string (all names to be serached are contained in column A).
I am trying to accompish this find and insert step using the find method, but I am having A LOT of trouble and, quite frankly, am on the verge of insanity. The workbook exists, the sheet exists, the range exists, the reference to the method is valid. I have no clue why this thing keeps spitting out an error at me. PLEASE help! I would greatly appreciate any advice you could give me! Here is the 'insert comments' section of the code- the debugger highlights the entire line that countains the find method:

PHP Code:
If Not (rs_subtaskcomments.EOF = True And rs_subtaskcomments.BOF = True) Then              '-----start of if comments rs non empty loop
'initialize the comments counter that keeps track of superscript- one superscript per name,
CommentCounter = 1
Dim foundnamecell As Variant
Dim orignamestring As String
Dim lenorigstring As Long
Dim commentstring_multline As String
'LOOP through Comments rs
Do While Not rs_subtaskcomments.EOF
'replace the space between different comment types with a new line
commentstring_multline = Replace(rs_subtaskcomments.Fields("CommentsSet"), ". ", vbNewLine)
'paste comments string below temps section
wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Value = _
CommentCounter & " " & commentstring_multline
wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Characters(Start:=1, Length:=0).Font.Superscript = True
wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Characters(Start:=2, Length:=0).Font.Superscript = False
'find the first place where employee name appears and paste superscript
'Set foundnamecell =
Dim namevalue As String
namevalue = rs_subtaskcomments.Fields("Name").Value
Debug.Print namevalue
foundnamecell = wb.sheets(currentsubtasktemplate).range("A1:A200").Find(What:=namevalue, After:=wb.range("A200"), LookIn:=xlValues, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
orignamestring = foundnamecell.Value
lenorigstring = Len(orignamestring)
foundnamecell.Value = orignamestring & CommentCounter
'convert inserted commentcounter to superscript
foundnamecell.Characters(Start:=lenorigstring + 1, Length:=0).Font.Superscript = True
'go to next commentcounter
CommentCounter = CommentCounter + 1
End If   '-----end of comments loop 
(working in access 2003)


I'm trying to use the following code (modified from something WayneRyan kindly sent me a while back) to get the text in the date/text box to flash red when the membership expiry date is close (within 30 days):

	Private Sub Form_Current()
  If Abs(DateDiff("d", Me![MembershipExpiryDate], Date)) < 30 Then
     Me![MembershipExpiryDate].ForeColor = 255
     Me![MembershipExpiryDate].ForeColor = 0
  End If
End Sub

Private Sub Form_Timer()
If Me![MembershipExpiryDate].Visible = True Then
    Me![MembershipExpiryDate].Visible = False
    Me![MembershipExpiryDate].Visible = True
End If

End Sub

Can anyone see where i'm going wrong? It doesn't go red, or flash (like they should when the date is close) and also i get an error 438 'object doesn't support property or object' when viewing some empty fields.

Anyone have any idea? I have set the timer interval to 1000.

Many thanks



I've been using this bit of code for a while now and I'm sure it worked a week ago, but suddenly its not.
I'm getting Runtime error 438 Object doesn’t support this property or method.
Can anyone help?


Public Sub ExpFile_Excel()
Mth = Format(Now, "YYYYMM")
Dte = Format(Now, "YYYYMMDD")
Tme = Format(Now, "HH-MM-SS")
Set FDialog = Application.FileDialog(msoFileDialogSaveAs)
With FDialog
.AllowMultiSelect = False
.InitialFileName = FileName
.Title = "ATMT: Please select a save location"
.Filters.Add "Microsoft Excel 2003", "*.xls"
.Filters.Add "Microsoft Excel 2007", "*.xlsx"
.Filters.Add "Microsoft Excel 2007", "*.xlsm"
If .Show = True Then
For Each varFile In .SelectedItems
DestFile = .SelectedItems(1)
End If
End With
End Sub


I want to disable a button right after click it. Because I could not disable a control that has got the focus, i tried to shift the focus to another control; however, all controls that I tried to shift the focus to don't support the method (SetFocus = true).

I want to do this on a subform's control, but I keep getting this error:
Object does not support this property or method.

Any susggestions will be very much appreciated.


I created a form called ExperationDialog. I used the directions in Microsoft Access help titled "Use a Form to Enter Report Creiteria" When I run the report I am getting an error that says:

"The object doesn't contain the Automation object "ExperationDialog"

You tried to runa VB Procedure to set a property or Method for an object. However, the component doesn't make the property or method available for Automation Operations.

Check the componts docuentation for information on the properties methods it makes available for automation operations."

I created an unbound form with a date range & 1 other criterion

I am trying to create a report that will filter through a table and tell me whose applications are going to expire within a 3 months time frame (or quarterly), for different divisions.

I created an unbound form to accept the division name and a Beginning date and an ending date.

I want the report to show the division and all of the companies that are assigned to that division whose applications are going to expire. I also need to have a few other fields on the report from the table.

In design view I created an unbound form and created macros for the form in a macro group. (OK, Cancel, OpenForm, CloseForm).

I used the IsLoaded function and defined the function in the database. This is where I think there might be an error. The directions said to use the code from the Northwinds Database. It did not work so well. I found some other sample code on the internet, but I still get the automation error. The code I used is:

Function IsLoaded(ByVal strExperationDialog As String) As Boolean
' Returns True if the specified form is open in Form view or Datasheet view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strExperationDialog) conObjStateClosed Then
If Forms(strExperationDialog).CurrentView conDesignView Then
IsLoaded = True
End If
End If

End Function

The code I found in the Northwind Database was:

Function IsLoaded(ByVal strFormName As String) As Boolean
' Returns True if the specified form is open in Form view or Datasheet view.
Dim oAccessObject As AccessObject

Set oAccessObject = CurrentProject.AllForms(strExperationDialog)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView acCurViewDesign Then
IsLoaded = True
End If
End If

End Function

I created a query using the table fields I needed and under the critera for Division I put:

and under the criteria for the Expiration Date I put:
Between [Forms]![ExperationDialog]![BeginninDate] And [Forms]![Ending Date]

I created a report using the report wizard and selected the fields from the query I created. When I run the report the form pops up, you enter the criteria and hit OK, and I get the error. After I get the error the report pops up. I get the error the first 3 times I run the report with the report poping up, but after that. The report does not generate and I do not recieve any more errors.

I did not understand the directions for what to do if it is an Access project. I am not sure if I am using an Access project or not? The database information in Visual Basics shows up as if it is a project, but that is in VB. I used the VB script to define the function for IsLoaded. How do I tell if it is an Access project .adp?

I don’t know what to do from here. How do I get this error message fixed?

Hi, I have recently transfered an MS Access d'base to SQL. Within the original MS d'base there was a list box that allowed users to select d'base entries and the details of the selection where then displayled. The code was

ynListSel = True
Dim rs As Object

With frm
Set rs = .Recordset.Clone
rs.FindFirst "ID = " & !lstRecords
.Bookmark = rs.Bookmark
!cmdNewRecord.Enabled = True
Since the transfer to SQL the list box code is no longer working and I get the error:-
End With

Set frm = Forms!frmMain
varInvoiceRef = frm!lstRecords

Object does not support this property or method

Does anyone know why???

Trying to read the Text in a combobox. The Value (usually an index) is available, but is not always what is needed. Sometimes we want the text.
The Text property is not available unless the control has the focus.
Here is an alternative

Run-time error '2185':
You can't reference a property or method for a control unless the control has the focus.

Read several quetions and feel that this is what people were asking for.
Did not readily find a post that puts the answer up front.
This might help the search.

Immediate Window example:
' combobox- retrieving Values
? Me!id_area.value
? Me!id_area.Text
*** SEE ERROR GENERATED --->>> 2185
Alternate Method
? Me!ID_Area.Column(0)
? Me!ID_Area.Column(1)
ND - Main Store

Note: Column(1) is a contrived value from two or more fields

msgbox "Thank You for choosing " & Me!ID_Area.Column(1), VBOKOnly, "Thanks Bonehead - for purchasing a T-Rex skull"

Also See:

On my form, I designated the textboxes and comboboxes which the user has to fill in in order to save a record by making their back color yellow. In the on click event of the Save button, I want to check if any of the yellow controls are blank:

PHP Code:
Dim ctl As Control
For Each ctl In Me.Controls
If Not ctl.Name = "SaveInvoiceRecord_button" And Not ctl.Name = "Box95" Then
If ctl.BackColor = 10092543 And Len(ctl.Value Note: the first If statement excludes 2 controls that should not be checked because they don't support either the back color property or the value property. When I try to hit save, I get error 438: object doesn't support this property or method. The line
PHP Code:
If ctl.BackColor = 10092543 And Len(ctl.Value is highlighted. All of the controls are either text boxes or comboboxes. I
tried just the backcolor criteria in that line and that works. It has to be the value criteria. I also tried the following,
none of which work:
if ctl.value= ""
if ctl= "'
if ctl.value= vbnullstring
if ctl= nullstring
if len(ctl.value)=0

Can anyone tell me why my textbox and combobox controls aren't supporting this property?

Thank you.

Not finding an answer? Try a Google search.