Link to home
Start Free TrialLog in
Avatar of lashler2
lashler2

asked on

Error 438 Obejct doesn't support property or method

I have a front end database that is being distributed to several users.  The front end works perfect on my laptop, and another desktop I tested it on.  

However when I placed the database on a second deskstop to test the following code gives me an error.

Note the code works perfect on the two previous pcs I tested it on so I am guessing the problem has to do with a setting.  can anyone help.

See code below.

Private Sub lockfields()
    For Each ctl In Forms!frmPurchaseOrderMain
        On Error Resume Next
        Err = 0
        Me(ctl.Name).Locked = True   <-------------------  Error Occurs Here
        On Error Resume Next
        Err = 0
    Next ctl
    Forms!frmPurchaseOrderMain.Refresh
    Forms!frmPurchaseOrderMain.Requery
End Sub
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Private Sub lockfields()
    For Each ctl In Forms!frmPurchaseOrderMain
        On Error Resume Next
        Err = 0
        Forms("frmPurchaseOrderMain")(ctl.Name).Locked = True
        On Error Resume Next
        Err = 0
    Next ctl
    Forms!frmPurchaseOrderMain.Refresh
    Forms!frmPurchaseOrderMain.Requery
End Sub
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lashler2
lashler2

ASKER

Thanks for the comments I will check to see if any of the suggestions fixed the problem when I go back to the computer giving the error in about two hours.  

I am still curious as to why the error will show up on one computer but not the other two?

Any suggestions?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial