Refer To A Numeric Variable?

Oct 8, 2010

In VB 2010, I am trying to use this query, but I always get an error message because the numerical variable CHAVE is not correctly called. STATUS and HISTORICO are string type fields, that will be filled by the string variables SITUACAO and DESCRICAO.DIA is a date type field and will be filled by the date type variable PROXIMA.CHAVE is a numerical field and should be filled by the numeric variable CHAVE.

sql = " INSERT INTO " & conta & " (status,dia,chave,historico)" & _
" VALUES ('" & situacao & "', #" & Format(proxima, "M/d/yy") & "#, & chave &, '" & descricao & "') "

View 6 Replies


ADVERTISEMENT

'dynamically' Refer To A Variable?

Aug 18, 2010

I have a bunch of string variables, string1, string2, string3 etc.At the end of my program I want to write these strings to a file, but I don't want to have to laboriously type out string1, string2, string3 etc.

It would be much easier to use a loop to dynamically refer to (string & loopcounter), ie reference the variable by dynamically concatenating its name from a string and a number. Python can do this with eval(). How does VB do it? I can think of loads of examples where it'd be useful. Otherwise I have to type out all the different conditions and that's not efficient.

View 1 Replies

VS 2008 Use A Variable To Refer To A Control By Name?

Jan 9, 2010

If I have a TextBox control with the Name Property = Textbox1, is there a way to use a variable for part of the name - like this:

Dim i as String = "1"
"TextBox" & i & ".Text" = "Hello"

View 3 Replies

Convert A Value Of A Numeric Up Down To A Variable?

Jan 15, 2011

How do you convert a value of a numeric up down to a variable?

View 1 Replies

Format A Variable To Numeric Characters?

May 20, 2009

how do i format a variable at runtime.

Here is my code
string cool = // some numeric value e.g. 500000
Label2.Text = " Payment of £ " + cool ;

[code].....

View 5 Replies

Numeric Up - Down Box - Display A Variable That The User Can Choose A Number For

Jul 24, 2011

I am using VB .net 2010 express from microsoft. I have a numeric up down box to display a variable that the user can choose a number for. Then I have a text box that I want to display a result of the updown box * 1.5... So far I have the following... What do I need or need to change? I have the integer variables initialized or whatever with Dim statements as follows -

'speed variables
Dim CruisingSpeed As Integer 'cruise speed - updown box
Dim FlankingSpeed As Integer 'Flanking speed - will be cruise * 1.5

[CODE]..................

It says that it cannot convert the up down box into an integer... I need it as an integer to calculate the other number...

Complete code just in case the above was not enough info...

'Imports Excel
'Imports System.IO

Public Class Form1

[CODE].............................

I have some stuff commented out because a variety of issues - some I will end up using and some I will end up taking out before it is done...

View 5 Replies

VB 2008 Why Are Static Variables Set Equal To 0 In The Declaration When 0 Would Be The Default Value Of The Numeric Variable

Apr 21, 2010

Why are static variables set equal to 0 in the declaration when 0 would be the default value of the numeric variable anyway when it's first declared? Not including the "=0" in the static declaration seems to work with no problem.

View 2 Replies

Is There A Numeric Text Box Not An Up-down Box A SIMPLE Numeric Box Into Which The User Can Place A Number

Apr 6, 2012

Is there a numeric text box, not an up-down box, a SIMPLE numeric box into which the user can place a number, 5 boxes actually, then on command have the five boxes added and the sum displayed?

View 8 Replies

Numeric And Non Numeric Data?

Jan 22, 2010

I am reading a data file and storing them in an array of string.Data is random, could be like "1","2","133,18" but sometimes there can be missing values like "?".Once I load the data in the array, I want to check if at least a majority (like 60% of them) are numeric values.If yes, then I wanna track down the higher and lowest value in the array, and output a range of 5.Loop through the array

If 60% of them are numbers (integers or decimals) then find highest value, find lowest value end if produce range

If for example lowest = 1 and highest = 100, range of 5 means 0,20,40,60,80,100 (so 5 ranges are 0-20, 20-40, 40-60, 60-80, 80-100).Also if the ranges turn to have decimals due to weird numbers, I would like to round them up.My problem is, in order to find highest and lowest when there are non numeric values in the array like "?", how should I handle those? I was thinking of something like Double.NaN but I would have to have an array of doubles.

View 3 Replies

Forms :: Refer To Another Sub?

Nov 28, 2009

I have a program that used information form treenodes and put them in the textbox after timer ticks the problem is that i should use AddHandler for ticking, but i dont know how to refer to the title() and name() because they are not on the same sub private

[Code]....

View 1 Replies

How To Refer To A MessageBox

Aug 25, 2009

I am amateur programmer.so far, I can use Visual Basic .Net only. That is all I know!!How can I refer to a MessageBox?or how can I Programatically handle a MessageBox after it is displayed?I need to close a MessageBox after certain time if no response from the user.

View 3 Replies

Refer To An Object By Its Name?

Jun 18, 2012

Is there a possible way to refer an object through it's name in Vb.Net?The case is, I have menu items created in my designer with names such as MenuA, MenuB and MenuC.On the database, I created a table consisting the list of all available menus in string format : MenuA, MenuB all the way to MenuZ.

Also I created a dynamic table consisting the user permission, what menu is accessible by a certain user.So when I started the app, it will get the name of menu assigned to the logged user, and start to turn the Visible property to TRUE.If it was a Control, I would just loop through it by Parent.Controls.Find(FoundMenu, True).My problem is most of it is not a control, it is an Item added to the Control, or even another SubItem added to the Item.So how can I found an object in my UI only by it's name?

SearchQuery = "SELECT menu_name FROM tbl_menulist menu, tbl_user user WHERE menu.id_menu = user.id_menu"
QueryReader = ExecuteQueryReader(SearchQuery)
QueryReader.Read()

[code]....

View 1 Replies

VS 2005 What Value Is Or What It Could Mean / Refer To

Jan 14, 2010

Can anyone tell me looking at this picture what Value is or what it could mean/reffer to? (S-1-5-xx-xxx)I had to block out some of it since I am not sure what it means.

View 2 Replies

VS 2008 Error: Range Variable 'sender' Hides A Variable In An Enclosing Block Or A Range Variable Previously Defined In The Query Expression

Mar 25, 2010

I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this

Imports System.Data.SqlClient
Imports System.Linq
Public Class Form1

[code]....

I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.

View 2 Replies

Can Refer To Samples Of Such Apps?

Aug 15, 2011

I would like to develop a VB.Net based smart device app. A simple one. Do any of u know where i can refer to samples of such apps?

View 2 Replies

How To Refer Text Box As Username

Nov 18, 2011

I am creating a project using VB, and I am new to VB, I am still a beginner, I need help in retrieving email address from database when I enter the username, I have added the code below, please review it and let me know, basically when I enter the username it has pull the email address and display in the label..[code]I am stuck at the sql statement as I have no idea how to refer the text box as the username i.e "& uname" it is the name of the text box, is it the right way, also then as I informed I need to paste the email address in the label and the name is label2, I am trying it as " label2.text=da" but I get a error message, I am using Visual basic professional 2010.

View 11 Replies

Cannot Refer To Itself Through Its Default Instance

Sep 2, 2009

am making a super advanced text processor and i am at the point where i am trying to make print preview dialog [code] Word_Env.Form1' cannot refer to itself through its default instance; use 'Me' instead.i have tried "Me" but that don't work.

View 2 Replies

How To Programmatically Refer To A Control

Aug 23, 2011

This was explained in a recent thread - but I can't find it again :-( Why won't the following work? I am trying to set the bounds on 9 buttons - Button11 to Button19. All these buttons are already added in design time. qli() is a rectangle array.

[Code]...

View 9 Replies

How To Refer To Columns In An Array

May 7, 2012

I am very new to programming so I apologize if I am asking really basic questions here, but how would I go about referring to a specific column in an array? I am trying to use the prices in one column of my array and multiply that by a quantity, but I am not sure how to extract the price out of the array.

[Code]...

View 4 Replies

How To Refer To Container Of A Usercontrol

Mar 9, 2011

I have a user control called UCO and it is being put in many diffrent forms.How can i refer to these forms from the code of the UCO?For instance, how can i get the color of the form and make the UCO have the same color?

View 1 Replies

Make A Control Refer To Itself?

Jan 13, 2009

Im working on a project and just wanted to know to make a control refer to itself?I know that by using the word "Me", the system refers to the form but how about the control. I know that i can simply name the control (e.g. txtSurname.Clear) but if i was to use the code on multiple controls it would save alot of time if the control could simply refer to itself!

View 7 Replies

Refer An Object In Its Own Event?

Dec 22, 2009

I am doing a calculator project.In the given code below I want to modify the line txtDigitPanel.Text = Trim(txtDigitPanel.Text) + "0" as txtDigitPanel.Text = Trim(txtDigitPanel.Text) + this.text (the word 'this' is taken as a reference to the object that has invoked the event ) to avoid hardcoding. Because when I copy the BtnZero, the same code will work for other digits also. Is it possible?

Private Sub BtnZero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Len(Trim(txtDigitPanel.Text)) < 15 Then
txtDigitPanel.Text = Trim(txtDigitPanel.Text) + "0"[code]....

View 3 Replies

Refer To .net Dll From A .net Web Application Asynchronously?

Feb 9, 2011

I've a vb.net web application where I'm referring to another vb.net dll by adding the reference of the dll and creating the object but after the call it waits for dll to finish operation and return a value before moving forward, is there a way I can do the same job asynchronously.

View 4 Replies

Refer To All Of One Type Of Control?

Jul 8, 2009

Refer to all of one type of control?

View 2 Replies

Refer To Form By String?

Dec 20, 2009

How do I refer to a form in my project by using a string variable? I'm running Visual Studio 2008.My main screen has a number of dropdown menus that, when an item is selected, a form will open:

Dim Mdi_frm_Doors As New frm_Doors Mdi_frm_Doors.MdiParent =Mdi_frm_Doors.Show()In this example, I am providing the name of the form directly (frm_Doors). What I would like to do is refer to the form as a string variable.I'm already doing something similar to access specific controls on other open forms (where str_Field is the name of the control I am accessing):

[Code]...

View 1 Replies

Refer To Label By Its Name In A String?

Apr 22, 2010

I have a string called testlabel, and would like to refer to it via the string "testlabel", how do I do this?

for instance:

dim testlabel as label
dim a as string = "test"
dim b as string = "label"

'what is the line I need here? a & b.text = "hello world"

to get testlabel.text to read "hello world"?

View 1 Replies

Refer To Many Checkboxes Or Other Controls At Once?

Dec 26, 2009

Refer to many checkboxes or other controls at once?

View 8 Replies

Refer To Object By String Value

Nov 12, 2010

Is there a way to reference an object by using the value of a string read from a text file? Here's an example of what I mean: I have a user control called 'Fish', one called 'Cats', and one called 'Dogs' and so on.... I have a text file containing this line, amongst many others in a long script written after compile time by the user:

[Code]...

View 2 Replies

Refer To Part Of An Array?

Apr 16, 2012

I'd like to know if it is possible to refer to section of an array. e.g.

dim a(10) as integer
foo(<reference to array a starting at item 2>) 'only use items 2 to 9 of the array
...
sub foo(byref a() as integer)
<do something with array>
end sub

Note that I don't want to copy the array to a new array or pass in indices, if I can avoid doing so. Subroutine foo should be able to process the array without knowing if it gets the whole array or just a section.

View 13 Replies

Refer To The Extendee From The Extender?

Jun 27, 2009

how can i implement iextender so it adds a property to all textboxes in my project. the class that i want to implement iextender from is a usercontrol, and the property will be similar to the imagelist property in listview properties. also how would i refer to the extendee from the extender?

View 2 Replies







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