VS 2008 : Loop Until The User Inputs A Valid Answer?

Feb 16, 2010

Is it possible for you to loop a block of code until the user provides a valid input? Like, when I click the save button, the program will prompt the user for an integer value, and I would like to validate if the user has inputted a valid value. If the user fails to input a valid value, then the program will re-prompt the same message again until the user inputs a valid value. Eg:

If MsgBox("Add copies to this book?", MsgBoxStyle.YesNo, "Adding Book Copies") = MsgBoxResult.Yes Then
Dim CopyQty As String = InputBox("Amount of copies to generate:", "Add Book Copy")
If IsNumeric(CopyQty) = False or (CopyQty < 1) Then

[code]....

View 12 Replies


ADVERTISEMENT

Unable To Check The Exercise Answer One By One As The User Inputs The Info?

Oct 5, 2010

I have a form that has 10 addition execises. The user has the option of using a timer or not. I have the timer part correct, but now I want to be able to check the exercise answer one by one as the user inputs the info.

[Code]...

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

Execute Based On Inputs From User?

Mar 3, 2009

I'm not sure the best way to accomplish this, what i have is 10 checkboxes on a form named chkbox1 to chkbox10, say ther user selects 4 then clicks a button, i was wanting to execute code one after each other like[code]...

View 3 Replies

User Form With 5 Specific Inputs

Dec 9, 2010

I'm trying to create a User form that has six inputs.

1.) User input textbox 5.00 to 60.0 inches only accepted.
2.) User input textbox 2.50 to 30.0 inches only accepted.
3.) User input textbox 6, 8, & 10 nominal input only accepted.
4.) User input textbox 60% or 65% only accepted.
5.) User input textbox 2.50 to 30.0 inches only.
6.) User input textbox where 500 shows up in the box as "standard" but can be changed by user input.

Then an "OK & Cancel" button. I don't know whether to use a dialog box or a form, what class, masked text box vs. not masked, etc.

View 14 Replies

VS 2010 - How To Validate User Inputs

Jan 18, 2012

How can I prevent users inserting sql injection in my database? How can I validate their inputs? I am new with this sql injection. I don't know how to prevent users to insert this sttmnentif and I don't have the idea of sql injection how can I be sure that I am safe with sql injection??

View 1 Replies

Building Webpage Out Of User Inputs Off A Form

Jun 25, 2009

I was trying to find examples of how one would make a webpage using asp so that I could have the visitor enter information on a form and then when they hit submit it will be attached to my webpage indefintaly and any visitor can view it.

View 4 Replies

Check If User Has Entered All Inputs And Go To The Next Form?

Sep 3, 2009

How do i check if user has entered all inputs and go to the next form.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
t1.Focus()
End Sub

[code]....

In this code it gives an error, but after displaying the error it jumps to next form.

View 5 Replies

How To Save Different User Inputs In Form To Harddisk

Jan 22, 2011

i have created a simple form which takes some input from the user. Now, I want that the input should be saved to my harddisk and can be seen later as well. Can you please tell me how to save the inputs as a record on my harddisk.

I mean the first time the form appears, it has four options. All the four options will be a record. The next time the form is re-loaded, then the same four fields will have data for someother client. It should be saved as another user.

View 3 Replies

Verify Multiple User Inputs With An Array?

Apr 28, 2012

I have several text boxes which a user is supposed to input a numeric value and the program will use an array to verify whether the input in each text box falls within the numeric range allowed for that text box. So one text box will only accept number 3-7 and i'm supposed to create an array that will verify the input in that text box falls within that range. Personally, I would just do:

Dim intInput1 as Integer
intInput1 = CInt(txtInput1.Text)
If intInput1 >= 3 or <= 7 Then
messagebox.show("Input Verified")
Else
messagebox.show("Input must be a numeric value between 3 and 7")
End If

But this isn't what the assignment asks.

View 1 Replies

Accessing User Inputs In Textboxes Created At Runtime?

Jul 13, 2009

I have created a page that creates a number textboxes at runtime depending on the result of a database query, (ie one textbox per row in query result). My problem is that I can't for the life of me work out how on earth to access the text from the textbox that is posted back to the server by the user when they press submit.

View 4 Replies

Database Condition - All Inputs Required From User On Form

Nov 4, 2009

I am building a program where all the inputs (10) required from the user are asked on one form. Since it is not possible to let fields blank on the database, I would like to know how can I build an 'IF' saying that if all fields are full, then the database CAN save all the input. So that if there are any field blank, it won't save. I just dont know how to do the database condition. Thats all.

View 3 Replies

Improve Speed Of Program - User Inputs Min And Max Values

May 3, 2012

I'm currently trying to improve the speed of my program. Basically the user inputs min and max values for a, b, c, and d and a constant n, and then it tries to find the curve/line in the form a (x/b + c) ^ n + d. However for large ranges (1-100 for a,b,c, and d; total of 100 million values to try), it would take around 100 minutes at the current rate (approx 800k values/minute). I'm wondering whether I can further improve the speed. [Code]

View 6 Replies

Listbox To Display A List Of Costs That The User Inputs?

Oct 14, 2009

This is what I'm trying to do: I have a listbox to display a list of costs that the user inputs. I want to use some kind of loop to add those numbers from the listbox sequentially, then display the total in a label.

How do I set up a loop (and what kind of loop is best) to pull the numbers and add them to a total? give an example of what the code might look like. I'm new to VB

View 6 Replies

Making The User Inputs Insert At The Cursor Position Instead Of At The End?

Jan 20, 2010

I'm making a program similar to a wordpad or whatever, but i'm having issues making the user inputs insert at the cursor position instead of at the end.. I'm running DevStudio 5 btw.

View 4 Replies

Program Where The User Enters 3 Inputs In A 3 Textboxes - First Name, Last Name, Birthday

Dec 7, 2009

Ok so i made a program where the user enters 3 inputs in a 3 textboxes (First Name, Last Name, Bday) and when the person presses enter a check list is made under the checklistbox with the Lastname. So can any1 tell me if i click on that checklist then everything i entered shows up in a label.

View 11 Replies

Data Type Validation - Get An Invalidcastexception If The User Inputs A String

Nov 25, 2009

Im trying to improve some apps ive written, the first is a console app... Im trying to get it so that i wont get an invalidcastexception if the user inputs a string, when the variable is type "Double"

[Code]....

View 2 Replies

Listview - Fill Out Of Information Gathered From User Inputs In Various Textboxes?

Feb 19, 2009

I have a listview with multiple columns that I need to fill out of information gathered from user inputs in various textboxes I use to have a code for Windows Forms Application as below

[code]...

This works fine.However,when I shifted to WPF and tried to reproduce EXACT same code,it tells me Too many arguments to 'Public Sub New()' Alternatively,
Basically I have about 15 data that I want to display in different columns per row in a listview.I need it in such a way I can sort, edit, delete, insert,etc.With my previous methods, I could do those fine, but in wpf im stuffed...

View 2 Replies

Return A Value That Is Set In A Radio Button And Add It To What Decimal A User Inputs Into A Text Box?

May 1, 2010

I am wondering how do i Return a value that is set in a Radio Button and Add it to what Decimal a User inputs into a Text box?

Public Class Form1
Private Sub txtbasic_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtbasic.TextChanged
End Sub

[code]....

i have 2 Error and 1 Warning Function 'OverTime Doesn't Return a value on all code paths.

1 Expression is not an array or a method, and cannot have an argument list

2 Expression is not an array or a method, and cannot have an argument list

View 4 Replies

URL Validation - Making A Small Webbrowser - User Inputs A Proper Url

Feb 28, 2010

I'm making a small webbrowser, and I need to make sure the user inputs a proper url!

The text box is called TextBoxAddress.

View 2 Replies

Test An Answer To A Simple Addition Sum That Is Input From The User To One Have Stored For The Question?

May 22, 2009

i am trying to make a simple Vb program for children to do simple maths, now im not sure im going about it the right way, i have stored all the questions in a database and have called them up to the form and that is working fine, i cant seem to get the right code to check the answer from the user against my stored answer, i am using txtBox to store my answer and a txtbox for the input

View 5 Replies

VB - User Substitutes Name On Query - Get The Data Set To Return Different Output Given A Variety Of Inputs

Nov 19, 2009

So, I run a select statement in SQL and then it has something like " where clientName = 'John Doe' " I can generate a datagrid or dataset off the SQL statement, but it will only be good fro one client...... I would like to be able to populate a dataset/grid using the select satement and then having something like a combo box of names the USER can choose. Then the user selects the name and the datagrid is populated with that clients info or w/e........

[Code]....

View 2 Replies

Exiting Msgbox - User Inputs Values Into Textboxes In Inputform, Then Runs The Check

Jun 6, 2011

I have a code which runs a check. User inputs values into textboxes in inputform, then runs the check, and the msgbox is displayed. if msg is yes then program continues, else I want it to return to the input for to change values in textboxes. How can I do that?

Below is the code.
If (optanodespacing > 300) Then
optanodespacing = 300
Dim answerspc As Integer = MsgBox("Anode Spacing Must NOT Exceed 300m,

[CODE]...

View 3 Replies

VS 2008 Stop A For Loop Until Have User Input?

Jan 5, 2010

any way to stop a for loop untill i have user input, once the input is correct continue the for loop, is that possible at all?

View 4 Replies

See If The Values A User Inputs Into 2 Textboxs Equals The Values Assigned To A Picture?

Apr 21, 2010

I want to be able to see if the values a user inputs into 2 textboxs equals the values assigned to a picture. I put these values in the picture's name and tag. Also the picturebox is getting the image from a random function correlating to an imagelist. How would i go about thisI thought of maybe using a checkbox and coding

If picturebox1.image.tag = ("12") _
and textbox1.text = 1 _
and textbox2.text = 2 Then
checkbox1.checked = true

unfortunatly when i debug it says the picturebox1.image.tag = Nothing

View 3 Replies

Make A Hospital Form Where The User Inputs Data For A Hospital Bill - Code Won't Work

Nov 13, 2011

'Declare the price rate per night
Const decNightly_Rate As Decimal = 350D
Private Sub btnCalculateCharges_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateCharges.Click

[code]...

I am trying to make a hospital form where the user inputs data for a hospital bill. I have to create three functions: CalcStayCharges, CalcMiscCharges, and CalcTotalCharges. I do not know why this code won't work.

View 13 Replies

VB 2008 Console - 2D Array - Infinite Loop - Program - User Enters The Number Of Enrollments For 5 Different Campuses During Two Semesters

Jun 12, 2011

I am trying to create a program that the user enters the number of enrollments for 5 different campuses during two semesters. I just got started and here is what I have so far but when I run the program it is stuck in an infinite loop and will not go to the next function. I am not sure how to end the loop.

Here is what I have so far:
Module Module1
Dim SIZE As Integer = 5
Dim campus() As String = {"Decatur Day", "Decatur Evening", "Huntsville Day", "Huntsville

[CODE]....

View 1 Replies

Stop A Loop Statement In VB And Not Perform Display Changes Until After Call Procedure Is Valid And Complete?

Apr 19, 2010

I am having problem with the coding of this (endless loop) and formatting of summary boxes before tests are complete that should not happen. (the overall goals is to have a separate validation procedure that does not calculate or dat displays are not performed until after call function is complete and valid. The validation that takes place are that two boxes are filled in - one is text and the other is a numeric value. (using vb 2008)

[Code]...

View 10 Replies

Vb 2008 - Retrieve Password In Database Using Secret Answer

Oct 2, 2010

how do i retrieve password in database using secret answer and email address and put the answer on label1.text? [Code]

View 2 Replies

Visual Basic 2008: Textbox Or Label For Displaying An Answer?

Mar 20, 2011

What is the advantage of using a text box to display an answer in Visual Basic versus a label?

View 2 Replies







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