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

if-and-then problem (i know -noob question- )

Private Sub cmd3_Click()
form3.Show
form2.Hide
End Sub
If cmd3_Click And box3.Text = box4.Text Then
score2.Caption = Val(score2) + 1
If cmd_click And box3.Text <> box4.Text Then
score1.Caption = Val(score1) + 1
End Sub

when i type this, the computer gives an error.
I already tried hundres of things but it doesn't work.
can someone help me pls

-peter-
Jul 4 '06 #1
6 10643
before i forget,
this is made in viusal basic excell.

-peter-
Jul 4 '06 #2
sashi
1,754 Expert 1GB
Hi there,

i have made some minor modification to your code n it should work fine now.. every if statement must end with endif.. always remember this when dealing with vb.. good luck my fren.. :)

Expand|Select|Wrap|Line Numbers
  1.   If <some condition> Then
  2.     ..do something..
  3.   EndIf
  4.  
Expand|Select|Wrap|Line Numbers
  1.   If <some condition> Then
  2.     ..do something..
  3.   ElseIf <another condition> Then
  4.     ..do something else.. 
  5.   EndIf
  6.  
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmd3_Click()
  2.    form3.Show
  3.    form2.Hide
  4. End Sub
  5.  
  6.   If cmd3_Click And box3.Text = box4.Text Then
  7.     score2.Caption = Val(score2) + 1
  8.   ElseIf cmd_click And box3.Text <> box4.Text Then
  9.     score1.Caption = Val(score1) + 1
  10.   EndIf
  11.  
  12. End Sub
  13.  
Jul 4 '06 #3
thank you very much
Jul 4 '06 #4
but when ido this i get an error that there's a function or variable is expected and the cmd3_click on rule 6 is marked in yellow.


-peter-
Jul 5 '06 #5
never mind, i found it myself
Jul 5 '06 #6
BSOB
77
i know you said you found it yourself. but im not sure if you meant you "found" it or "fixed" it. cmd3_click does not evalute to true or false. if you are trying to find if the button has been clicked make a boolean variable (in general declarations) and have the button click event sub set the variable to true. then have your if statement look at the variable.
Jul 15 '06 #7

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

Similar topics

10
by: Matt Hollingsworth | last post by:
Hello, Very new to python, so a noob question. When I've written stuff in JavaScript or MEL in the past, I've always adopted the variable naming convention of using a $ as the first character...
5
by: Tony Vasquez | last post by:
Hi fellas. I have a problem. I am trying ot get a popup window to appear in the center of the screen, both vertically and horozontally. I am trying to display a large version of an image in this...
3
by: We need more power captain | last post by:
Hi, I know less than a noob, I've been asked to do some compiles in VC++ 6 without knowing too much at all. (I'm a COBOL program normally so this is all too much for me) I open VC++6, open...
8
by: Ivan Shevanski | last post by:
Alright heres another noob question for everyone. Alright, say I have a menu like this. print "1. . .Start" print "2. . .End" choice1 = raw_input("> ") and then I had this to determine what...
2
by: Dan McCollick | last post by:
Hi All, Noob question that I can not seem to figure out: I am trying to implement a screenscraper to pull data from two seperate websites, here is some test code so far: public static void...
2
by: tavspamnofwd | last post by:
I'm a total noob, and I'm trying to understand this code: var newsi = { name:"newsi", dom:false }; newsi.Client=function(){ //stuff }
6
by: Lang Murphy | last post by:
I'm baaaaack... some of you answered a question I had last week. Only problem is: I'm a dope who doesn't understand most of what y'all posted. Raw noob when it comes to .Net and C#. So I'm going...
4
by: Arch Stanton | last post by:
I'm trying to bind data in a dataset (obtained from an Access DB) to a listbox in ASP.net. I know my dataset is being created properly because it displays fine in a datagrid, but I can't get it to...
1
by: SCRIPT KEEPER | last post by:
Hello, I am a complete noob and just starting off with csharp so I apologize for my basic question. I am wanting to start powershell from inside a batch script and then to pass the powershell args...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.