Conditioning - Cannot Put 2 Condition At A Time, Only 1 Is Working

Nov 11, 2010

Im having a problem on conditioning, i cannot put 2 condition at a time, only 1 is working , i need to put the condition where if the user inputs blank number there will be a msgbox and a condition when a user inputs a number lower than 45 there will also be a messagebox.

CODE:

View 8 Replies


ADVERTISEMENT

VS 2010 For Loop Condition Met Not Working

Oct 28, 2011

I have a list of string in an array. I'm loop through those strings and if the text of a combo box matches one of those strings, I want a message to appear. If they don't match, I want a method to be executed.

[CODE...]

The messagebox appears, but the method is still executed. Which means it isn't stopping when it finds the match. I tried exiting the loop, but it still doesn't work.

View 4 Replies

Conditioning The Values In The Column Of Datagridview?

Mar 15, 2012

i have a datagridview on my form with customers info which is linked to my database. i want to execute a line of code based on the information in one of the columns in the datagridview??? for example i have a datetime column which stores dates(and maybe time) i want to use an if statement(or any code) to compare the date the customer entered. if its today then my code will execute!!

View 4 Replies

VS 2005 : Draw Two Lines On The Same Time (1 Line On Rotate Condition)?

Sep 24, 2009

i want to draw a line on my picture box but i would like have another line but on rotate condition (on the same time i move my mouse to draw a line)

-i know how to draw a line

-i know how to rotate a picture

but i don't know how to combine that two things

Private m_LastPoint As Point = Nothing
Dim LPen As New Pen(System.Drawing.Color.Black)
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PicPad.MouseDown

[code]....

View 22 Replies

Check A Check Box Based On A Condition At Run Time?

Jun 4, 2011

How to check a check box based on a condition at run time?

View 3 Replies

Why Is This Not Working 75% Of The Time

Dec 24, 2011

Why is this not working 75% of the time? It never gives anything but 50% and 100%

vb
Dim percentComplete As Double = ((completedVariables * 1.0 / (listOfButtonsToPress.Count - 1.0)) * 100)lblPercentComplete.Text = "Percent complete: " & percentComplete & "%"If completedVariables < listOfButtonsToPress.Count - 1 Then completedVariables += 1End If

View 1 Replies

Ctrl+S Key Not Working All The Time?

Mar 6, 2012

I have a form in which there is a datagrid and one Save button pnly.I want to save data also by pressing "Ctrl + S".I am using below code. but, its not working all the time means if there is focus on form,.....How can i achieve this. Tell me some modification like on which event i should do this.....

If e.Modifiers = Keys.Control And e.KeyCode = Keys.S Then
MsgBox("Ctrl + S is Pressed.", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)
'--- Condition Here.
End If

View 4 Replies

Working With Date / Time On Sql

Feb 15, 2012

I need help in saving datetime to sql database.

[Code]...

View 8 Replies

Working With Date And Time In .net

Apr 14, 2010

I have values which is the hours worked on a project for each day of the week.I would like to add all the values and get the consolidated amount of hours worked each week.If i have two values of the format hh:mm:ss like 03:15:00 and 02:20:00.The total should be 05:35:00.Is there any function to add time format as produced above.

View 3 Replies

Cancel Button Some Time Not Working?

Sep 21, 2011

Cancel Button Some time not working

View 3 Replies

OpenFileDialog.InitialDirectory Only Working 98% Of The Time?

Jun 4, 2012

I've got my program to run a set of code based between certain variables. The variables are:

RBM (Radiobutton for male gender)
RBF (Radiobutton for female gender)

Based on that, it runs a new sub which then does a select case based on ClassBox (Listbox) index.

Now here is what I don't get. When I run the code, it works flawlessly except on ONE of the case selects.
Here is what I've got for the codes:

[Code]...

If I select anything, it loads the correct directory. The error isn't the case selects, I put them in there in case I missed something. I ran debugger with breakpoints so I could see if the data was getting crossed wrong. When I select index 4 on the female sub it loads the correct directory and I set a breakpoint for "OFD1.InitialDirectory = Race" which Race showed the correct directory, but when the OFD1 came up, it's not the folder 91 (Index 4 in female), it goes to 80 (Index 7 in male) which isn't even a female option and it's not the same index in the male section either.

View 3 Replies

DateDiff Not Working Correctly When The Date Has Time Specified In AM/PM?

Jul 22, 2009

I found very wiered behaviour for DateDiff. or any other kind to date difference methods avalibale when Date has AM/PM specified in it.

Cl.LunchStartTime =
"2009/7/13 12:10:00 AM"
Cl.LunchEndTime =

[code].....

View 2 Replies

Make Child Forms Working At The Same Time?

Feb 9, 2010

In this example I want the loop button works in all mdi child forms at the same time; now in the first mdi child form it will work, but when getting a new mdi child form with that, it will stop in the first one!

View 3 Replies

VS 2008 - Working With Two Forms (Focus On Both) At Same Time

Jan 18, 2011

I have a form from which I am visually representing data (from access database). I have set up a user log on a separate form (allows user to make comments as they scroll through the data and see any points of interest etc). The second form is linked via a textbox in terms of a common field in this case the field name is "Datetime".

What I want to do is be able to scroll through the data and make notes on the second form and add them to another table in the database. I have managed to do all the above but obviously loose focus of the second form when i scroll through the data on the first. Is there any way of being able to interact with both forms at the same time?

View 6 Replies

VS 2008 Working With Date And Time Strings

Jun 10, 2011

I'm importing data from an excel file. They have a date column like 06/07/2011 and a time1in column with a value like 13:00:00. Now I convert the datestring to a date like this:

[Code]....

View 2 Replies

.Net 2005 Ghost Text Box - Unable To Get It Working All The Time?

Feb 22, 2010

I've been trying to make up a Ghost Text Box, so that it shows some 'ghost' text when its contains nothing.

What i did was inherit from the normal textbox, and use OnPaint to show the ghost text, the User paint is switch on/off depending on if there is any text in the textbox.If i start (in the design) and add some text it all works as i expect at runtime, but the text does not get shown at design time (for some reason)

If i clear the text at design time, then it shows the ghosted text at design tim. At runtime the ghosted text is shown, but when you click in the box and hit a key, the key is shown in bold, which is odd as the font is not in bold.

[Code]...

View 1 Replies

C# - Convert A Date And Time To UTC Time Based On The Time Zone Of The User?

Sep 6, 2009

I have an ASP.NET application with a SQL Server back end. I am storing all my dates in UTC format and doing the appropriate conversions to the local time zone of the browser viewing it. One of the pages asks for a start date and end date (no times).

I am taking the start date and setting the time to 00:00:00 hours (midnight) and I'm taking the End time and adding a time of 23:59:59, so that the date range covers the whole day. Now what I'm trying to do is do a SQL query to do a search for records in this date range. The problem is, the data in SQL is in UTC time and the user is typing their dates and times in their local date and times. My quickest solution was to convert the date and time to UTC, then search the records. However, by doing this, I am to believe ASP.NET converts the given time and date to UTC based on the server time zone. How can I convert a date and time to UTC time based on the time zone of the user?

View 5 Replies

Use Less Condition For Many Condition?

Aug 10, 2011

i mean for e.g., numbers are between 1 and 100 .i want to show messagebox for each number as text for example "One" for 1.

View 1 Replies

.net Dropdownlist If Condition?

Oct 18, 2010

I had posted this question before but didn't get the right answer -here's my code again with the if condition.

Dim provider As CultureInfo = CultureInfo.InvariantCulture
Dim a1 As DateTime = Nothing
If date1.selectedvalue isnot nothing Then

[code]....

View 4 Replies

25 Alphanumeric Key With Condition?

Sep 25, 2011

I have a problem. I have been programming an activation type of security protection for my software but i ran into problems when i try to generate an alphanumeric key with conditions. i cant seem to be able to make the keys to be valid with the condition. Basically i can get the 25 keys but all of them seem to be returning 1 (ones) instead of 0 (zero which what i want. below is my sample code may be someone can tell me what i am doing

[Code]...

View 1 Replies

Exit Sub If Condition Is Met?

Dec 8, 2009

I have the following code which gives me an error at run time. The problem is when TxtSearch.Text - is not an integer a message box should be prompted saying- Only a numeric value is allowed in this field, otherwise continue with the sub.

Private Sub ButtonSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSearch.Click
Dim query As String

[Code].....

The error I receive is showing ''saved_prac = cmd.ExecuteScalar()''..

First it brings the Message box - Only a numeric value is allowed in this field. When I OK it, then it brings another message box "error converting data type varchar to numeric". When you click OK the application crashes...

View 6 Replies

Go To End Of Loop If Condition Is Met?

Jun 20, 2010

What is the correct syntax to go to the next sequence in a loop if certain conditions are met bypassing the contents.

I am using goto and inserting a line number which is probably not the best way.

I.E. My syntax:
For i = 0 to 100
If i = myvariable goto 100
Functions to be performed

[Code]....

View 8 Replies

How To Add Values Until Condition

Nov 15, 2010

When I am click a button every time adding +1 in a textbox but I want to give condition that it will add until the desite is 8 I am using the following code

If e.KeyCode = Keys.Down Then
textbox1.text = Val(textbox1.tex)+ 1
End If

View 2 Replies

Next Condition Won't Execute

Sep 15, 2011

I'm trying to read data from database.

If objReader.Read = True Then
If objReader("cell") IsNot DBNull.Value Then
Me.txtContact.Text = Trim(objReader("cell"))

[code]....

Problem is, no data displays if cell is empty.

View 8 Replies

Put If Condition On Textbox

May 21, 2011

my problem is that i want to put if condition on textbox for example i want if key board keypress on textbox then enter no in textbox

[Code]...

View 9 Replies

Race Condition With GDI+?

Jan 21, 2012

I use a worker thread to do the procedure of query and fill the datasetAnd I use 3rd party component called DevExpress XtraGrid: GridControl to view the query outputI don't forget to use invoke and delegate to set the GridControl.datasourceOn Timer.Tick(), the thread is started and the procedure is called user has scrolled down the GridControl, even only one scroll value instead,and then the Timer.Tick() fired, I gottwo errors randomly. Mostly aNullReferenceException error and eventually anInvalidOperationException error

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo.UpdateCellAppearance(GridCellInfo

[code].....

View 1 Replies

SQL Group By With A Condition?

Aug 16, 2011

Scenario: I need to create a report for the auditors for an ASP.Net application. I have a program that parses the XML of the web.config files in a directory for the authorization tag and creates a report providing which users have access to which folder in the site structure. The report is shown below.

UserName, Firstname, LastName, Directory, Roles, Access,
LastLoginDate

Problem: As you can see from the report some directories (the middle column with GISMO in it) show up twice, with both allow and deny for a user. I am wondering if there is a way to group the results in such a way that if there is a row that has allow for a directory then the deny's are not shown but otherwise they are.

Alternatively if this can be manipulated in VB.net/C# that is also an option. It comes back there and is pumped into an Excel spreadsheet.Edit: I should have explained better. I still need the deny rows to show if the user isn't allowed in the directory. But if they are allowed then there is no point showing the deny rows.

View 4 Replies

Sum With Multiple Condition?

May 14, 2010

I am developing an application to my official use. In which I have one combo box for selecting the customerName.When I select the custName from the combobox I want to retrieve data from a particular field of a table and sum it within a selected date value. i.e: When the user selects a custName from the combobox the field within the date value should be summed up and grouped by custName. I think it is possible but I dont know how it is to be done.

View 10 Replies

.net - If Then Statement Condition Being Ignored With Optimizations On?

Jun 16, 2010

I think im going mad but can some show me what im missing, it must be some stupidly simple i just cant see the wood for the trees.BOTH side of this if then else statement are being executed?

Ive tried commenting out the true side and moving the condition to a seperate variable with the same result. However if i explicitly set the condition to 1=0 or 1=1 then the if then statement is operating as i would expect. i.e. only executing one side of the equation...

The only time ive seen this sort of thing is when the compiler has crashed and is no longer compiling (without visible indication that its not) but ive restarted studio with the same results, ive cleaned the solution, built and rebuilt with no change?

Dim dset As DataSet = New DataSet
If (CboCustomers.SelectedValue IsNot Nothing) AndAlso (CboCustomers.SelectedValue <> "") Then
Dim Sql As String = "Select sal.SalesOrderNo As SalesOrder,cus.CustomerName,has.SerialNo,

[code]....

View 4 Replies

Add Checkbox In First Column As Per Some Condition

Sep 16, 2011

I have one datagridview with first column may contain checkbox or could be empty space depending upon data in second column. How can I put checkbox or keep it empty in first column whever required ? Checkbox column puts check box in all cells of first column.

View 1 Replies







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