473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

compile error:Method or data member not found

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
1 2652
ADezii
8,834 Expert 8TB
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

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

Similar topics

1
by: Vincento Harris | last post by:
Anyone knows what would cause this?When Enterprise Manager is used to open a table Runtime error data provider or other service provided an efail status
0
by: Kenny G | last post by:
Hello, Got a small problem: I built a small table and used the following on my laptop this morning. This code compiled and worked fine on my laptop but when I compiled the first Sub on my...
2
by: bradleyp | last post by:
Hi all, Hopefully somebody can help. In Access 2002-SP2, I receive an error from the VB Editor if I try to compile the following code (see below). The error is as follows: Compile Error:...
2
by: Reginald Bal | last post by:
Hello, I created a main form with 2 subforms. In an attempt to move to the next record (or new record) on the main form I get the error " Method 'requery' of object '_Subform' failed". The...
0
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. Asset List is a long array of AssetIds. I declare it as: Dim AssetList(0) As Long AssetList(0) = 47288 Now, I pass an array of AssetIDs as long from here into the...
3
by: Dan | last post by:
Hi, I'm learning asp.net 2.0 and i get this error: "Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource" My code: Dim a As GridView Dim...
3
by: DThreadgill | last post by:
Upon trying to compile my db, I get the following error - "Compile Error - Method or Data Member Not Found" and it highlights the .backcolor of the following code Private Sub...
0
by: amuven | last post by:
Hi All, I have created xls using pyExcelerator. when i tried to open that xls sheet i'm getting this error message "File error: data may have been lost " , Please some one help me how to rectify...
0
by: Blubaugh, David A. | last post by:
Sir, Let me state that do have extensive experience with developing binary files. Please note that I have followed all of the instructions to the letter as far as developing a DLL to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.