How To Do An If Statement Based On The Yes Or No Answer Of A Message Box

Sep 27, 2009

how I could do an if statement based on the yes or no answer of a message box...as follows

messagebox.show("do you wish to discard all information?" "Discard", MessageBoxButtons.YesNo)
if messagebox = yes then
...
else
...
end if

View 3 Replies


ADVERTISEMENT

Asp.net - Creating A Message Box, If Dropdown Answer Is Yes?

Mar 3, 2011

I have a working dropdown box that gives the answers yes & no.When "yes" is selected I need to create a message box that displays a simple message and allows the user to click ok, to get back to the survey.I have been working with it, and tried several things but no luck. What would the code look like, and where exactly would I place it to fire at the right time.I am working in VB, with an aspx & aspx.vb page.

View 3 Replies

Check Exist Database In SQL And Message Box Show Answer?

Oct 3, 2009

how to Check Exist Database in SQL And Message box Show Answer?

View 4 Replies

Message Syntax Error In Update Statement ?

Aug 19, 2009

[code]

May i know what is going wrong to my Update statement.

View 1 Replies

DB/Reporting :: Different Message Based On Table Field Contents?

May 8, 2008

I am working on a 1-page report, that basically consists to select 1 record from table and bind values to proper fields (eg. =Fields!name.Value).However, I have one field in the table that will be just "Y" or "N".When this field will be "Y" I would like to show in the report "Yes, I do."; otherwise I would like to show "No, I dont."

View 1 Replies

Reducing An If Statement Based On Checkbox / Radio Button?

Jan 11, 2012

I have a project in which I have to display a picture box based on:

Which radio box is checked

and

if a checkbox to make the picture box visible is checked. As someone who values clean, good code this is my code and it horrifies me. My question, is there some way to condense the following using cases or some other construct I don't know in VB.net?

If CheckBox1.Checked = False Then
BooksPictureBox.Visible = False
MusicPictureBox.Visible = False

[Code]....

Note- all the images stack on one another, and all of them start without being visible.

View 3 Replies

Select Case Statement Based On Data Type

Oct 20, 2009

I want to be able to have a case for each data system data type. Obviousely the code below doesnt work but it should make it easier to understand my question.

[Code]...

View 4 Replies

Use A Select Case Statement That Evaluates PostDiscountCost Based On The Value 0 To 999.99?

Oct 1, 2011

I need to use a select case statement that evaluates PostDiscountCost based on the value 0 to 999.99, 1000.00 to 1499.99, 1500.00 to 2499.99 and one that doesn't fall within the others. The message box's going to be triggered by the vbYes in the confirm exit message box. Im not asking anyone to do it for me, I just have no idea where to start it, if I need to declare anything else and if I'm on the right track. Code Attached.

View 1 Replies

How To Concatenate Multiple Strings Into Message Box Based On User Response

Nov 12, 2010

So, what I have is a windows form with multiple user selections. I need to display one message box upon click which concatenates strings based on the users input. The message box needs to show each specific reason why the user is declined. I'm typing out some really basic pseudocode below to give the basic structure of what I'm trying to do. [code]

View 4 Replies

If Statement (ASP.NET) - Compiler Error Message: BC30201: Expression Expected

Apr 11, 2011

[Code]....

This code is giving an error: Compiler Error Message: BC30201: Expression expected. I just basically want to check if two values are equal but its saying something about expression expected although i've given the expression to evaluate.

View 2 Replies

System.Data.OleDb.OleDbException Was Unhandled By User Code ErrorCode=-2147217900 Message=Syntax Error In INSERT INTO Statement

Jul 8, 2011

I cannot seem to figure out why VB keep throwing me this exception but here is the code

[Code]...

View 3 Replies

Database - Compare Two Fields In An SQL SELECT Statement To Then Select Other Fields Based On This Result?

Apr 8, 2012

I have a table which contains a list of products for a company. They input data about how much stock they have and also the level at which they want to be reminded that they need to order new stock.

[Code]...

I want to list all the true results in a form which the user is then able to navigate through. What would be the best way to go about doing this?

View 2 Replies

Get Rid Of Zero Or Replace It With 'Answer'?

Jul 11, 2011

I wrote my first program today and it works like I want it to Except when the Message box pops up there is a zero there untell you press the OK button then the answer displayes. How do I get rid of the zero or replace it with "Answer"?the program consist of 2 buttons, a labes, and a text box, when you enter a number in the text box then press button 1 the answer displayes in the label. If you press button 2 the answer displayes in a message box.I am new to programing and this is the first program i wrote without following a tutorial or book.[code]

View 14 Replies

Can't Get A Clear Answer What To Use ToString For?

Feb 22, 2009

I've googled like crazy and tried MSDN but I can't get a clear answer what to use ToString for.

View 11 Replies

Get The Answer Of A String Formula?

Apr 27, 2011

In the user input of a textbox I would like that the user can input a formula to make it easier for him. So instead of inputing 400 I would like the user to have the possibility to input as 8*50. Is there a command for vb2008 to calculate the answer of this formula inputed by a string ?

View 2 Replies

Get The Loop To Stop When It Has The Same Answer Twice In A Row?

Jul 2, 2009

[Code]....

As this Loops round, the answer for formula will eventually become the same as what was input, X. How can I get the Loop to stop when it has the same answer twice in a row? The counter will count how many times it has had to Loop before finding the repeated answer.

View 3 Replies

Quadratic Calculator - Answer Comes Up As NaN

May 29, 2010

I'm new to the server and I'm making a quadratic calculator with my friend. I have my calculator coded, but whenever i click the calculate button the answer comes up as "NaN". Here is the code.
TextBox4.Text = (intVarB * (-1)) + (((intVarB ^ 2 - (4 * (intVarA * intVarC))) ^ 0.5) / (2 * intVarA))
The Variables "IntVarA", IntVarB, and IntVarC are defined as public variables in a code module.

View 4 Replies

Rotating Answer Came From Database?

Apr 8, 2010

i am going to create one system which is related to test skill and it is in VB.Net and access database it has a question and four answer. both are coming from database,my problem is how do i change answer sequence everytime.whenever user tried for the test, answer sequence should be different.

View 14 Replies

.net - Rectangle Width(probably Easy To Answer) VB?

May 2, 2012

Dim energybar As New Rectangle(9, 154, energy, 21)That is my new rectangle, now when I draw it e.Graphics.FillRectangle(Brushes.Blue, energybar)It says there is no width but the integer energy is = to 100...now, how do I fix this? It but be somewhat simple.

View 1 Replies

Answer Fax Call - Start Receiving?

Jun 3, 2011

I have installed the fax service in windows. I want to write a code in vb.net program that start receiving from a fax call.

View 2 Replies

Auto-answer Dialog Boxes?

Apr 1, 2009

I am writing a program for FEMAP API interface in VB 2008 Express. Some API commands open user dialog boxes which requires yes or OKcancel inputs. So much for automation "Sendkeys" do not work, because code execution stalls at the line which opens the dialog boxes. I need stg that runs in parallel, watches for these dialog boxes, and sends the right keystroke at the right time.

View 7 Replies

Calculating Value And Showing Answer In Label?

Jan 24, 2012

I have several buttons in my form and they each need to add, subtract, divide and multiply certain values together but I seem to be having problems with this. I didn't expect anything to go wrong and its probably a rookie mistake, but take my first calculation for example; a user must enter a value in a textbox (txtDays) and and also when one of my various radio buttons are pressed a value shows in a label (lblDailyHireCharge). I now need a way of multiplying these values to give me my answer shown in a label. I have done this by adding a button when which pressed multiplies the txtDays value with the lblDailyHireCharge and then shows it in the label, however it keeps on showing "0" when i click it.

Below is my code, I am basically saying that the value of both of those figures is intDuration and that lblDuration is where I want it to go when the button is clicked.
Private Sub btnDuration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDuration.Click
Dim intdays As Integer
Dim intDailyHireCharge As Integer
Dim intDuration As Integer
[Code] .....

View 10 Replies

Change Color Of Text According To Answer?

Oct 10, 2010

This might be a basic question but I am just starting in VB. How can you change the color of the text of a form if a person selects they are a boy or girl. I want the text to be blue if they select boy and pink if they select girl.

View 2 Replies

ComboBox Results Equaling A Answer?

Feb 4, 2011

I have 3 ComboBox, I need the selection of the combobox to equal a number, (for example, the first option would = 1, second option would =4 and so on).the numbers will then be added up to show the sum.

View 2 Replies

Concatenate A Equation And Answer To Text Box?

Mar 22, 2011

In our school theres a programming class and the teachers gone for the week and the sub is starting to get very frustrated, so I offered to help in any way i can. I have never programmed Visual Basic but I have programmed Ms-Dos, Javascript, HTML, *.vbs, *.ahk, *.gml, and a variety of other languages.

The class is going to build a program that calculate how many rabbits are born in a family. So when they click the button it shows in a text box the actual equation and then the answer after the equal sign that where i assume concatenation comes in.Here's the code I've thrown together for when the buttons pressed:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RabitAmount As Integer
Dim ShowEquation As String

[code]....

I got the equation to answer it self and show in the text box but it won't show the equation?

View 7 Replies

Evaluating An Algebraic Equation And Getting The Answer?

Jun 19, 2009

I store a formula in the database such as the following:GrossIncome+(Overtime/0.5)-Deductions=BasicNetIncome

I am able to substitute the string representations with actually values entered, thus:1000+(150*0.5)-100=BasicNetIncome

Then I remove the '=BasicNetIncome', thus:
1000+(150*0.5)-100

How can evaluate the above equation to return a result:

[Code]...

View 1 Replies

Flowchart Drawn At The End Of Your Answer Document?

Apr 12, 2010

I am just starting to learn this programming. But of this is very challenging. The question is:Explain what the code in the GuessLetter procedure you added does.Add your answer as a flowchart drawn at the end of your answer document. You can use the Word Draw tools to draw the flowchart. HINT: Your flowchart should have four decision points. Here is the code for Hang Man.

[Code]...

View 3 Replies

Have TextBox On A Form In Separate Answer's

Feb 4, 2011

I Have a textBox on a form to give me my IP address (but I have 3 anwser's going into 1 textBox) When I use a button to revile The anwser's,all in one Textbox .How can I seperate Each anwser's with a space. Code Below: (TextBox5 is the TextBox I need to seperate the Answers) [code]

View 12 Replies

How To Squeeze Answer In Radio Button

Mar 17, 2009

I have a radio button. Four in fact. All connected to a database. The Radio buttons are the answers to the questions. Button A, B,C, and D. Now in the database some of the answers are very short, one or two words, but some can very lengthy. So, my answers seem to disappear if lengthy (argh), I cannot make them shorter. How do I squeeze the answer in the Radio button? Can I add what.I do not want to change from radio button to something due to the extreme low knowledge of VB08.

View 9 Replies

NumberDecimalSeparator Is Giving The Wrong Answer?

Oct 16, 2009

I've got this code to get the decimal and groupseparator settings on a computer:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NumFormat As New System.Globalization.NumberFormatInfo

[Code]....

The problem is that on my computer NumberDecimalSeparator should return "," and NumberGroupSeparator should return ".", but it's just the other way around when I try to get both separators from my system. What could be going wrong, and even more important, how to get the right strings? I did check my locale setting to make sure I'm not crazy and I also didn't switch the textboxes.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved