Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 19th, 2007, 04:01 PM
coco coco is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 7 coco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 22 sec
Reputation Power: 0
Compound If Block

Hi,

This is the code I am tackling:

Private Sub Text428_Click()
If (Option390 = "1" And Option396 = "1") Then
Me.Text428 = (Val(Me.sbwt.Value) / (Val(Me.sbht.Value) * Val(Me.sbht.Value))) * 703
ElseIf (Option392 = "2" And Option398 = "2") Then
Me.Text428 = Val(Me.sbwt.Value) / ((Val(Me.sbht.Value) / 100) * (Val(Me.sbht.Value) / 100))
End If
End Sub

Basically it's calculating Body Mass Index which consists of height (sbht) and weight (sbwt), each of which can be given in either of two units (Height unit can either be Option390 or Option392; Weight unit can either be Option396 or Option398). Text428 is the field of the BMI value

When I try to run the action (i.e. click Text428 on the form), I get the following error:

Run-time error '2427':
You entered an expression that has no value

And the line that's highlighted above in the code is pointed out.

Any insight?

Reply With Quote
  #2  
Old June 20th, 2007, 09:50 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
no line in the code is highlighted.
what line cause that error?

Reply With Quote
  #3  
Old June 20th, 2007, 03:30 PM
mattgb1 mattgb1 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2007
Location: Brooklyn, NY
Posts: 133 mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level)mattgb1 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 7 h 6 m 58 sec
Reputation Power: 57
Here's a dumb qquestion: do sbht and sbwt have existing values? If you out a breakpoint there, what do they show? also, how are they declared?

Reply With Quote
  #4  
Old June 21st, 2007, 10:57 AM
coco coco is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 7 coco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 22 sec
Reputation Power: 0
Compound If block

Sorry I didnt highlight the line that caused the error; it is the second line (counting from the top) starting with the "If" statement

Private Sub Text428_Click()
If (Option390 = "1" And Option396 = "1") Then
Me.Text428 = (Val(Me.sbwt.Value) / (Val(Me.sbht.Value) * Val(Me.sbht.Value))) * 703
ElseIf (Option392 = "2" And Option398 = "2") Then
Me.Text428 = Val(Me.sbwt.Value) / ((Val(Me.sbht.Value) / 100) * (Val(Me.sbht.Value) / 100))
End If
End Sub

And the sbwt and sbht values will be entered and on click of Text428, I would like BMI to be calculated in the field Text428

Reply With Quote
  #5  
Old June 21st, 2007, 11:36 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,932 Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1Folding Points: 391471 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 12 h 17 m 53 sec
Reputation Power: 2002
what are Option390 and Option396? where are they defined?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Compound If Block


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT