PC Review


Reply
Thread Tools Rate Thread

Could someone check out this code it corrupts my project file

 
 
Gary Shane Lim
Guest
Posts: n/a
 
      24th Jul 2003
Could someone check out this code it corrupts my project file
----------------------------------------------------------------------------
----
I have the following code in my project in varying ways this one being the
smallest. Last time I build a new solution added this project and dragged my
forms over which fixed the problem. However once I created another of this
type I corrupted my file again. By corrupted I mean that I get an error on
run but not on step through. ((see post here)) This code is an adaptation
of and evb program I inherited that works so I am guessing something either
is no longer supported or I have it wrong. And ideas?




Sub summarize_Understory()
Dim Sum As Double
Dim Nrated As Short
Dim Mean As Double
Sum = 0
Nrated = 0
Dim sumUnder() As TextBox
ReDim sumUnder(2)
sumUnder(0) = txtASum
sumUnder(1) = txtBSum
sumUnder(2) = txtCSum
Dim nratedUnder() As TextBox
ReDim nratedUnder(2)
nratedUnder(0) = txtANRated
nratedUnder(1) = txtBNRated
nratedUnder(2) = txtCNRated
Dim i As Short
For i = 0 To 2
If Not (Len(sumUnder(i).Text) = 0) Then
Sum = Sum + CDbl(sumUnder(i).Text)
End If
If Not (Len(nratedUnder(i).Text) = 0) Then
Nrated = Nrated + CDbl(nratedUnder(i).Text)
End If
Next
If Nrated > 0 Then
Mean = Sum / Nrated
Else
Mean = 0
End If
MessageBox.Show(Sum.ToString & Nrated.ToString & Mean.ToString)
End Sub





 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code corrupts file (XL2003) ker_01 Microsoft Excel Programming 3 1st Jun 2010 06:16 PM
RE: Code corrupts file (XL2003) ker_01 Microsoft Excel Programming 2 27th May 2010 10:46 PM
C# 2005 how to remove warning "The file 'C:\Main.cs' does not support code parsing or generation because it is not contained within a project that supports code. Serdge Kooleman Microsoft C# .NET 0 9th Feb 2006 05:43 PM
Re: Code works in one MDB, but corrupts. Code doesn't work in a new M John Nurick Microsoft Access VBA Modules 1 22nd Aug 2004 01:13 AM
code to check for project references in VBA Qasim Ahmad Microsoft Excel Programming 2 14th Jan 2004 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:04 AM.