Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Development - Programming / Coding
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-14-2002, 07:18 PM   #1
Adi-2k1
Registered User
 
Join Date: Oct 2001
Location: Frisco, TX
Posts: 23
Exclamation Visual Basic problem... help me please

Hello all,

I'm trying to make a vb application but I ran into some trouble.

I'm trying to make a simple application that has two labels stacked under one another and two buttons besides the labels that say "Start" and "Done." The top label will only have instructions in it, so it's no big deal but the 2nd label, which would be underneath the first label, should display the answer which I'm about to explain.

When the user clicks "Start" on the application, it should pop up 5 Input boxed one after another asking the user how many visitors they recieve each day on their website. When the first input box pops up the user types in the number of visitors he got that day, then after he pushed "OK" another input box pops up and asks him the same question again. This goes on for five input boxed, asking the user for the visitor for 5 days of visitors that came to their site. When the user is done with putting in all the information, and hits "OK" for the last time, it should give him the average number of hits that he recieves for each day out of the five days that he entered. This answer should be displayed in the lower label.

Now, here is the code that I tried to use to make this application work, but I'm 100% that I messed up alot so I'm asking some of you to modify it and if possible make my application work. Here goes my code:
-------------------------------------------------------------------------------
Option Explicit
_________________________
Private Sub cmdStart_Click()
Dim int1 As Integer, int2 As Integer, int3 As Integer, int4 As Integer, int5 As Integer, int6 As Integer
Dim intC As Integer
Const intD As Integer = 5

lblAverage.Caption = ""
Do
Loop While int4 = InputBox("Enter Average Daily Attendence", "Attendence")
int1 = int1 + int4
Do
Loop While int3 = InputBox("Enter Average Daily Attendence", "Attendence")
int1 = int1 + int3
Do
Loop While int2 = InputBox("Enter Average Daily Attendence", "Attendence")
int1 = int1 + int2
Do
Loop While int5 = InputBox("Enter Average Daily Attendence", "Attendence")
int1 = int1 + int5
Do
Loop While int6 = InputBox("Enter Average Daily Attendence", "Attendence")
int1 = int1 + int6
lblAverage = int4 + int3 + int2 + int5 + int6 / intD
End Sub
_________________________
Private Sub cmdDone_click()
Unload Me
End Sub
_________________________
-------------------------------------------------------------------------------
OK, that would be the code that I have for right now. It's not totally done, because I'm stuck and it looks totally wrong. If I'm using a wrong method please correct me.

I will appriciate all the help that I can get
Adi-2k1 is offline   Reply With Quote
Old 01-28-2002, 05:40 AM   #2
TSSR
Registered User
 
Join Date: Dec 2000
Location: UK (South West)
Posts: 104
Default

My my, you do see some interesting coding

Something simpler would be as follows ( if I've understood correctly )

nDays = 5

For nLoop = 1 To nDays
nDayTotal = Val(InputBox("Enter Daily Attendance For Day " & nLoop, "Attendance"))
nTotal = nTotal + nDayTotal
Next nLoop

lblAverage.Caption = nTotal / nDays
TSSR is offline   Reply With Quote
Old 01-28-2002, 09:16 PM   #3
Adi-2k1
Registered User
 
Join Date: Oct 2001
Location: Frisco, TX
Posts: 23
Default

Heheh, I got it all figured out.
Thanx
Adi-2k1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript Exit Console Problem WildComputer Web Design and Webmaster Issues 3 12-01-2008 03:57 AM
Problem with domain name or ISP inogenius Web Design and Webmaster Issues 1 10-24-2001 02:14 PM
Engage & Adtegrity "problem" eca Making Money with CPC and/or CPM Programs 11 06-07-2001 11:20 PM
Advices on ASP, Visual Basic, Visual C++ fatso Web Design and Webmaster Issues 6 10-19-1999 01:07 PM
Problem with Gotoworld Newton Making Money with CPC and/or CPM Programs 4 07-30-1999 06:05 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 01:43 AM.


GeekVillage.com is copyright © 1998-2015 Curiosity Cave - Science gifts for clever kids. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.