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:


	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)
        Else
            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
            ProjectSort
    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


Sponsored Links:



Hi,
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:

	Code:
	Form_Load_Error:
    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

Form_Load_Exit:
    Exit Sub

Form_Load_Error:
    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
CDlg1.ShowOpen
'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)
UpdateSettings
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")
Else
' MsgBox "Only Excel files are importing at this time."
' Exit Sub
SFileName = BrowseFilename("Find Comma Seperated Value file", "csv")
End If


Thanks,

Lou




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.

	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
           .AddNew
              !company = scompany
              !Address = saddress

'Subform fields

With SRst
     .AddNew
     !SequenceNumber = sSequenceNumber
     !SequenceDescription = sSequenceDescription

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

Exit_btnduplicate_Click:
        Me.Refresh
        Exit Sub

Err_btnDuplicate_Click:
        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.

Regards
Ria




Hello,

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,
Darshi.




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

jsl

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

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




Hey,

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:

	Code:
	 
Object doesn't support property or method

My code is the following:

	Code:
	 
    appExcel.ActiveSheet.Rows("23:23").Select
    appExcel.ActiveSheet.Range("B23").Activate
    appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    appExcel.ActiveSheet.Rows("30:30").Select
    appExcel.ActiveSheet.Range("B30").Activate
    appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    appExcel.ActiveSheet.Rows("18:18").Select
    appExcel.ActiveSheet.Range("B18").Activate
    appExcel.ActiveSheet.Selection.Copy
    appExcel.ActiveSheet.Rows("23:23").Select
    appExcel.ActiveSheet.Range("B23").Activate
    appExcel.ActiveSheet.ActiveSheet.Paste
    appExcel.ActiveSheet.Rows("30:30").Select
    appExcel.ActiveSheet.Range("B30").Activate
    appExcel.ActiveSheet.ActiveSheet.Paste

Where appExcel is my Excel Object declared as:


	Code:
	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.

Victor




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:

	Code:
	 
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
    Me.subfrmAccountAdd1.SetFocus
    DoCmd.GoToRecord , , acNewRec
    Me.subfrmAccountAdd1.[CompanyID] = AddCompID
    Me.subfrmAccountAdd1.[AccountNumber].SetFocus
Exit_AddNewAccount_Click:
    Exit Sub
Err_AddNewAccount_Click:
    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

	Code:
	 
Private Sub SaveNewAccount_Click()
On Error GoTo Err_SaveNewAccount_Click
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Forms!frmCompanyEntry!subfrmAccounts.Form.Requery
    Forms!frmCompanyEntry!CoName.SetFocus
    Forms!frmCompanyEntry!subfrmAccountAdd1.Visible = False
Exit_SaveNewAccount_Click:
    Exit Sub
Err_SaveNewAccount_Click:
    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.




Hi,

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

Thanks

Lia




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
rs_subtaskcomments.MoveFirst
 
'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
Loop
End If   '-----end of comments loop 
(working in access 2003)




Hi

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


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

Private Sub Form_Timer()
If Me![MembershipExpiryDate].Visible = True Then
    Me![MembershipExpiryDate].Visible = False
Else
    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

Eddie




Hello,

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?

Thanks


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.Clear
.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)
Next
End If
End With
End Sub