musclecarlover07
Registered User.
- Local time
- Today, 12:03
- Joined
- May 4, 2012
- Messages
- 236
I have an array that is not working 
So basically When I open the form to a specific record I want certain fields to be hidden. To determine if the fields are hidden or not are the values I have in the array. So example if I open record 10 and in the text field UpgradeType equals to any of the following 3, 4, 8, 13, 14 then I want other fields to hide.
If it equals anything else then I don't want anything to happen. But every time I rut the above code it gives me error mismatch and highlights
Not sure whats wrong. When ever it gives me the error I hit debug and then over over Utype and it says 13 and then hover over Me.UpgradeType and it says 13 :banghead:

Code:
Dim Utype As Variant
Utype = Array(3, 4, 8, 13, 14)
If Utype = Me.UpgradeType Then
MsgBox "working"
Else
MsgBox "not working"
End If
So basically When I open the form to a specific record I want certain fields to be hidden. To determine if the fields are hidden or not are the values I have in the array. So example if I open record 10 and in the text field UpgradeType equals to any of the following 3, 4, 8, 13, 14 then I want other fields to hide.
If it equals anything else then I don't want anything to happen. But every time I rut the above code it gives me error mismatch and highlights
Code:
If Utype = Me.UpgradeType Then
Not sure whats wrong. When ever it gives me the error I hit debug and then over over Utype and it says 13 and then hover over Me.UpgradeType and it says 13 :banghead: