473,388 Members | 1,298 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,388 software developers and data experts.

Error 2427: I have four radio/option buttons, and I am using office 2010

1
I am getting error 2427 but cant trace where I am wrong. Below is my code.

Expand|Select|Wrap|Line Numbers
  1. Private Sub CmdCalc_Click()
  2. Dim Area As Integer
  3. Dim Lenght As Integer
  4. Dim Breadth As Integer
  5. Dim Base As Integer
  6. Dim Radius As Integer
  7. Dim pi As Integer
  8. pi = 3.142
  9.  
  10. If OptCircle.Value = True Then (THIS IS WHERE THE ERROR IS)
  11. InputBox ("enter radius")
  12. Radius = intInputbox
  13. Area = pi * Radius * Radius
  14. LblAnswer = Area
  15.  
  16. End If
  17.  
  18. End Sub
Nov 19 '12 #1
4 2240
TheSmileyCoder
2,322 Expert Mod 2GB
Hi and welcome to Bytes.
When posting errors always post both the error number as well as the error description.

At the very top of your module, you will likely see written:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
Below that line add:
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
And then try to compile your project, and see what errors appear. I spot a few undeclared variables such as intInputbox which is neither declared nor assigned anywhere.

If lblAnswer is truly a label then you need to know that you cannot assign values to labels. To change labels you need to access the Caption property.
Expand|Select|Wrap|Line Numbers
  1. Me.LblAnswer.Caption=Area
I find that always using Me. syntax when using controls on the form makes it easier to read the code, and avoid mistakes.

Post back with the error description, and maybe I can guide you further.
Nov 19 '12 #2
zmbd
5,501 Expert Mod 4TB
OptCircle.Value=true
I am guessing that this is an option button?
I am guessing that you have a series of option buttons in a group box?
If both are true (even if it is just one option button inside the group box) the the option buttons no-longer have a value... instead the group box takes the value of the positional number of the option button within the group box.
Nov 19 '12 #3
ADezii
8,834 Expert 8TB
Are you specifically using Access 2010?
Nov 19 '12 #4
NeoPa
32,556 Expert Mod 16PB
Please start at Before Posting (VBA or SQL) Code. It saves everyone time and energy.

Now, you probably need to understand that Integer variables will not hold Real numbers. Line #8 then is a problem.

I suggest you fix all of the really basic problems already mentioned then come back to us, if you are still having issues, with the new code and a properly explained problem.
Nov 19 '12 #5

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

Similar topics

3
by: Edward | last post by:
I have a data entry form that allows the user to navigate around entirely using the keyboard. However, it contains various option button controls which are in the tab order. Whenever they are...
2
by: Steven | last post by:
Ok.. Stupid question.. But.. How do you set an option button (radio button) to be a default one. I have a group box and have added 5 option buttons. None of them come up as a default one and I...
3
by: Dot net work | last post by:
Is it possible to have a radiobuttonlist control appear on a webform without any radio buttons checked to begin with? I would really like to make sure that the user specifically chooses a radio...
5
by: Killer42 | last post by:
Hi all. I'm coming from a VB6 background so this is just confusing me a little. I have a form where the user can select one of a number of years to search. The selection doesn't relate directly to...
4
by: alive84 | last post by:
Hi everyone, I am going nuts with radio/option buttons. Maybe someone can give me a hint how to solve my issue. Problem: I have three fields with radio buttons, External <> Internal <> N/A...
3
by: kalyanibal | last post by:
can anybody help me out with my problem. in my submit form i have three radio buttons with the title "Mr,Mrs,Miss". how to select one radio button from the above three by using c# code behind....
0
by: betchay1219 | last post by:
How can I data bind radio buttons or option button using VB.Net , window application
5
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con =...
1
by: Jim de la Combe | last post by:
We developed boiler plates with VSTO (C#) and MS WORD 2010. When users use these VSTO templates to create documents and these documents are saved, the next time the users open these documents, there...
0
by: alison owens | last post by:
I'm using Outlook on Office 2010 have been receiving e-mails and sending ok, but today can only receive. Get message server error:- 550 relaying denied. Any ideas please?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.