View Single Post
Old 09-11-2004, 09:58 PM   #1 (permalink)
Mewgen1
 
Junior Techie

Join Date: Sep 2002

Posts: 70

Mewgen1 is on a distinguished road

Question Newbie VB Problems

Hi all. First I would like to apologize for what I am sure will turn into the first of many questions about this language that have very simple answers. I am currently taking a Visual Basic course in college and we just got our first homework assignment. I built the interface and then started inputting code for a command button. It’s intended to take the name of a Baseball team, their number of wins and their number of losses then, when the cmd button is clicked; it’s supposed to put a statement in a picture box that tells the teams percentage of wins. Unfortunately, once thought that I was finished and executed it, it gave me a message that says "Method or Data member not found"


So my questions are:

1. What did I do wrong in my code?

2. What exactly does this error mean?

I’m using VB6 working model edition which apparently doesn’t come with any help files. Please feel free to point out any other potential problems that I might be having.

Since I can’t attach the form file I'll just post the code here.

<code>
Private Sub cmdCompute_Click()

Dim Team As String
Dim Won As Integer
Dim Lost As Integer
Dim Total As Integer

Team = txtTeam.Text
Won = Val(txtWon.Text)
Lost = Val(txtLost.Text)
Total = Won + Lost

picPercent.Cls
picPercent.Print Team & "won"; Total / Won & "percent of its games."


End Sub
</code>
__________________
Windows XP Proffesional SP2
Pentium 4b CPU 2.66GHz
-533 Mhz FSB
Biostar U8598 (downscaled) >.<
-VIA P4X400-8235 Chipset
-Phoenix - AwardBIOS v6.00PG
1024MB DDR400 RAM (single stick)
BFG NVIDIA GeForce 6800GT OC
-256.0 MB VRAM
-Forceware 84.21
-DirectX 9.0d
SB Audigy 2 ZS
Mewgen1 is offline