If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > run time error 438, object doesnt support this property

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-16-10, 14:44
trey3143 trey3143 is offline
Registered User
 
Join Date: Jan 2010
Posts: 13
run time error 438, object doesnt support this property

I have tried changing this vba code any which way and cant get error messages to disappear. I am trying to lock old records and unlock for new forms. I have done this for one form field but cant get this peice of code to work. The field I am working with is a combo box. Thanks

Private Sub Form_Open(Cancel As Integer)
Dim ContainerForm As Form
If Nz(Form.Containertype) = 0 Then
Form.Containertype.Locked = False
Else
Form.Containertype.Locked = True
End If
End Sub
Reply With Quote
  #2 (permalink)  
Old 02-16-10, 16:11
trey3143 trey3143 is offline
Registered User
 
Join Date: Jan 2010
Posts: 13
Okay I fixed that by changing the names of the fields into container all over the place to make that work, but now I can't get it to unlock from locked. What should I have in the place where the 0 is to check the field if it is a text. I tried null and that didnt work
Reply With Quote
  #3 (permalink)  
Old 02-16-10, 17:26
trey3143 trey3143 is offline
Registered User
 
Join Date: Jan 2010
Posts: 13
K, I know my problem, I fixed all the code and forms and I ran it on sub Form_current and it worked but I already have the same lock unlock happening on current, so I need this container to lock on another like Form_open event or on_click but neither seem to work correctly, any suggestions?
Please help
Reply With Quote
  #4 (permalink)  
Old 02-16-10, 17:32
trey3143 trey3143 is offline
Registered User
 
Join Date: Jan 2010
Posts: 13
K, I know my problem, I fixed all the code and forms and I ran it on sub Form_current and it worked but I already have the same lock unlock happening on current, so I need this container to lock on another like Form_open event or on_click but neither seem to work correctly, any suggestions?
Please help
Reply With Quote
  #5 (permalink)  
Old 02-25-10, 19:39
AnanthaP AnanthaP is offline
Registered User
 
Join Date: May 2009
Location: India
Posts: 62
]I think the problem lies with

Code:
If Nz(Form.Containertype) = 0
because it seems to me that the condition is always failing and so executing the else part.

A way to check it out would be to swap the conditions thus.
Code:
If Nz(Form.Containertype) = 0 Then
Form.Containertype.Locked = True
Else
Form.Containertype.Locked = False
End If
or maybe simply:
With NZ

End
Reply With Quote
Reply

Tags
438, error, vba

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On