By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

compile error:Method or data member not found

P: 26
I have two combo boxes on my form, let's say box1(s1_individual_session) and box2(s1_nationality1), initially I disable box2(gray-out). I want to select box1 value is "true" then enable the box2,

the code:


Private Sub s1_individual_session_AfterUpdate()
If Me.s1_individual_session.Value = True Then
Me.s1_nationality1.Enabled = True
Else
Me.s1_nationality1.Enabled = False
End If
End Sub



but it gave me compile error:Method or data member not found, I don't know what caused the problem, I started my current project without any knowledge of Access programming. thanks.
Oct 1 '08 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,669
The problem is, that once an item is selected in a Combo Box, its value doesn't return True or False, but the Name of the item selected:
Expand|Select|Wrap|Line Numbers
  1. Private Sub s1_individual_session_AfterUpdate()
  2. If Me.s1_individual_Session.Value = "<some value in the Combo Box>" Then
  3.   Me.s1_nationality1.Enabled = True
  4. Else
  5.   Me.s1_nationality1.Enabled = False
  6. End If
  7. End Sub
Oct 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.