getting info to display in text boxes


rated by 0 users hi
i have a screen where most of the textboxes are been pulled and filled by database which i press my update button.

but im doing this new part to it where it looks for midrange values from the info in the datbase and what i want to it is when it runs to display the info in the text boxes not been populate by db
here is my code Open OPXCOM$ + "\MidRating.TXT" For Input As #fn Do While Not EOF(fn) Line Input #fn, sBuffer ' Input #fn, sBuffer TempArray = Split(sBuffer, ",") ' this will split the data on each comma ' convert your text data into integers for the subroutine MidLevelPostNotched (TempArray(0)), (TempArray(1)), (TempArray(2)) sRatingAgency = (Text2(0).Text) iMidLevelPostNotched = (Text2(2).Text) Loop result = 0 MidRange_Exit: Exit Function MidRange_Error: ErrorRoutine$ = "MidRange" Gerr Err End Function     Public Sub MidLevelPostNotched(iMoodys As Integer, iSP As Integer, iFitch As Integer) Dim iHighest As Integer Dim iArr As Variant If iMoodys = 0 Or iSP = 0 Or iFitch = 0 Then 'get highest value iHighest = iMoodys sRatingAgency = MOODYS_TITLE If iSP > iHighest Then iHighest = iSP sRatingAgency = SP_TITLE End If If iFitch > iHighest Then iHighest = iFitch sRatingAgency = FITCH_TITLE End If iMidLevelPostNotched = iHighest Else 'get median value - Sort the array and get the mid value iArr = Array(0, iMoodys, iSP, iFitch) ' Sort the Array and display the values in order. BubbleSort iArr iMidLevelPostNotched = iArr(2) If iMidLevelPostNotched = iMoodys Then sRatingAgency = MOODYS_TITLE ElseIf iMidLevelPostNotched = iSP Then sRatingAgency = SP_TITLE ElseIf iMidLevelPostNotched = iFitch Then sRatingAgency = FITCH_TITLE End If End If End Sub     and ideas how i can do this from about code was trying it like this but doesnt work sRatingAgency = (Text2(0).Text) iMidLevelPostNotched = (Text2(2).Text)     or do i have to add it to table before i can pull it back dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('8527793793e342e6ac529b8d23dec5a0') dp.SyntaxHighlighter.Highlight('1355108adb2f4300897b53fdbe93d4d4') dp.SyntaxHighlighter.Highlight('feb03a6e3a844016b2749a3a03d9e4e9')
Posted On: Thursday 13th of September 2012 10:41:44 PM Total Views:  39
View Complete with Replies

RELATED TOPICS OF Visual Basic PROGRAMMING LANGUAGE




using xsd with xml for getting data frm SQL

i need to get data from sql databse to XML file using XSD in VB6
VIEWS ON THIS POST

65

Posted on:

Friday 14th September 2012
View Replies!

Could you please help me in getting started?

rated by 0 users Hi! I have designed tables for creating a survey form (in asp.net) in my project. They are as shown below. But now I am feeling problem in creating the survey form (web page). I don't know what and how to use. Could you please help me in creating the survey form in asp.net It would be appreciable if you can provide me with a sample code or example.
VIEWS ON THIS POST

83

Posted on:

Friday 14th September 2012
View Replies!

recordset nt getting updated

i have a recorset which is made from excel sheet in vb6.0 & thenthe recorset is populated with truedbgrid its wrking fine now i need to edit the records . when i change the cell values it visiblie on the grid but  after the updatebatch command fr recordset when i debug i get the same old values in the recordset the recordset is nt getting updated
VIEWS ON THIS POST

167

Posted on:

Monday 17th September 2012
View Replies!

problems getting values from external config file

hi to all i am building a web application with VS2010 and framework 4 in the web.config i havedefinedthe external file path running the application on my machine everything goes ok... when i run the application on the server i get null values in other web applications done with VS2008 and framework 2 or 3,5 everything goes ok the Global_Settings.config file the connections folder and my project folder are at the same level in the wwwroot folder on the server some help please i am a beat lost with this thanks for the reply dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('1b5dcb1fce60483bad12ee1eefcb6039') dp.SyntaxHighlighter.Highlight('ab3faab4bce54f7ba8bad95360eca5eb')
VIEWS ON THIS POST

152

Posted on:

Friday 21st September 2012
View Replies!

getting an error "User defined type not defined. This was working in access 2003 but not in access2007

Private Sub UpdateRelationshipSegmentQuery_Click()On Error GoTo Err_UpdateRelationshipSegmentQuery_Click \t Dim stDocName As String\t Dim rst As ADODB.Recordset\t \t stDocName = "qry_DelSegmentRelationship"\t DoCmd.OpenQuery stDocName, acNormal, acEdit \t stDocName = [Forms]![frm_BuildRelationshipSegment]![QueryName]\t DoCmd.OpenQuery stDocName, acNormal, acEdit \t Set rst = New ADODB.Recordset\t rst.ActiveConnection = CurrentProject.Connection\t rst.CursorType = adOpenStatic\t rst.Open "Select * from tbl_SegmentLink Where tbl_SegmentLink.Segment_ID = " & Me.Recordset.ID\t Me.Recordset.Edit\t Me!rstCount = rst.RecordCount\t Me.Recordset.Update Exit_UpdateRelationshipSegmentQuery:\t Exit Sub Err_UpdateRelationshipSegmentQuery_Click:\t MsgBox Err.Description\t Resume Exit_UpdateRelationshipSegmentQueryEnd Sub Please tell me what I am doing wrong in the above code. I did was transfer the database from access 2003 to 207 by using the import function. I checked everything that I could thnk off and am still getting this error.
VIEWS ON THIS POST

154

Posted on:

Friday 21st September 2012
View Replies!

Not getting dial tone when dialing with tone dialing in TAPI

I am dialing a US Number 1(XXX)XXXXXXX but it seems it is directly dialing a tone number without a dial tone. please help me with dial tone.\t\t\t\t
VIEWS ON THIS POST

69

Posted on:

Sunday 23rd September 2012
View Replies!

getting little square characters in output

I am sending SNMP Systemdescription query to local host and in response i m getting little square characters instead of the specific system description..It seems like my prog is supporting some of the data types like it correctly gives system name and time but is giving some unrecognizable characters when i query system descripton.. Imports System.Text Imports System.Net Imports System.Net.Sockets Imports snmpClass Class Form1 Dim commlength As Integer, miblength As Integer, datatype As Integer, datalength As Integer, datastart As Integer Dim uptime As Integer = 0 Dim output As String Dim conn As New SNMP() Dim response As Byte() = New Byte(2500) {} ' Public Shared Sub Main(ByVal argv As String()) 'End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load DataGridView1.Columns.Add("Column One", "Oid Description") DataGridView1.Columns.Add("Column Three", "Type") DataGridView1.Columns.Add("Column Four", "Value") IPaddress.Text = "192.168.100.1" Community.Text = "public" TextBox1.Text = "Device SNMP information:" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For Each Item In ComboBox1.SelectedItem Call DataGridView1ComboChanged(sender, e) Next Item End Sub Private Sub DataGridView1ComboChanged(ByVal sender As Object, ByVal e As EventArgs) Select Case datatype Case datatype = &H4 Select Case ComboBox1.SelectedItem Case "1.3.6.1.2.1.1.5.0" response = conn.[get]("get", IPaddress.Text, Community.Text, "1.3.6.1.2.1.1.5.0") If response(0) = &HFF Then MessageBox.Show("No response from " & IPaddress.Text) Return End If ' If response, get the community name and MIB lengths commlength = Convert.ToInt16(response(6)) miblength = Convert.ToInt16(response(23 + commlength)) ' Extract the MIB data from the SNMP response datatype = Convert.ToInt16(response(24 + commlength + miblength)) datalength = Convert.ToInt16(response(25 + commlength + miblength)) datastart = 26 + commlength + miblength output = Encoding.ASCII.GetString(response, datastart, datalength) DataGridView1.Rows.Add("sysName", "OctetString", output) Case "1.3.6.1.2.1.1.6.0" response = conn.[get]("get", IPaddress.Text, Community.Text, "1.3.6.1.2.1.1.6.0") If response(0) = &HFF Then MessageBox.Show("No response from " & IPaddress.Text) Return End If ' If response, get the community name and MIB lengths commlength = Convert.ToInt16(response(6)) miblength = Convert.ToInt16(response(23 + commlength)) ' Extract the MIB data from the SNMP response datatype = Convert.ToInt16(response(24 + commlength + miblength)) datalength = Convert.ToInt16(response(25 + commlength + miblength)) datastart = 26 + commlength + miblength output = Encoding.ASCII.GetString(response, datastart, datalength) DataGridView1.Rows.Add("sysLocation", "Octet String", output) Case "1.3.6.1.2.1.1.1.0" response = conn.[get]("get", IPaddress.Text, Community.Text, "1.3.6.1.2.1.1.1.0") If response(0) = &HFF Then MessageBox.Show("No response from " & IPaddress.Text) Return End If ' If response, get the community name and MIB lengths commlength = Convert.ToInt16(response(6)) miblength = Convert.ToInt16(response(23 + commlength)) ' Extract the MIB data from the SNMP response datatype = Convert.ToInt16(24 + commlength + miblength) datalength = Convert.ToInt16(response(25 + commlength + miblength)) datastart = 26 + commlength + miblength output = ASCIIEncoding.ASCII.GetString(response, datastart, datalength) ' If response, get the community name and MIB lengths DataGridView1.Rows.Add("sysDescr", "OctetString", output) End Select End Select Select Case datatype Case datatype = &H43 Select Case ComboBox1.SelectedItem Case "1.3.6.1.2.1.1.3.0" response = conn.[get]("get", IPaddress.Text, Community.Text, "1.3.6.1.2.1.1.3.0") If response(0) = &HFF Then MessageBox.Show("No response from " & IPaddress.Text) Return End If ' If response, get the community name and MIB lengths commlength = Convert.ToInt16(response(6)) miblength = Convert.ToInt16(response(23 + commlength)) ' Extract the MIB data from the SNMP response datatype = Convert.ToInt16(response(24 + commlength + miblength)) datalength = Convert.ToInt16(response(25 + commlength + miblength)) datastart = 26 + commlength + miblength While datalength > 0 uptime = (uptime
VIEWS ON THIS POST

75

Posted on:

Sunday 23rd September 2012
View Replies!

getting Some Specific Value using String Manipulation Function

The charachter from 4th to 6 is a storeid .when i do =MID(A3,4,3) i am able to take storeid .but samething i want to achieve .using another string manipulation fucntion left ,right or any other function .can you tell me how should i achieve it any help would be highly appreciated.
VIEWS ON THIS POST

134

Posted on:

Tuesday 25th September 2012
View Replies!

How to know application is getting closed ?

Hi , I need an event which should get fired when app is getting closed or aborted due an error. Can any one give hav any idea Thx in advance.
VIEWS ON THIS POST

181

Posted on:

Monday 1st October 2012
View Replies!

WebClient.DownloadString not getting the whole HTML string

I've searched everywhere and can't find a solution for this. I'm working on a project that scrapes data from government websites. I've noticed that whenever I use WebClient it doesn't always get the whole HTML code. Even when I get the robots.txt file it doesn't return everything. For example, http://www.bbc.co.uk/robots.txt has 80 lines but I'm only getting 13 lines. If an HTML block uses "display: none" in the style I can't get anything between the hidden HTML blocks. Here is the sample code I'm using: Imports System.Net Public Module Common Public Function GetPageHTML(ByVal strURL As String) Dim objClient As WebClient = New WebClient() Dim strReturn As String = String.Empty Try objClient.Headers.Add("Cookie", "CommunityServer-UserCookie") strReturn = objClient.DownloadString(strURL) Catch ex As Exception Throw ex End Try Return strReturn End Function End Module Is there any way I can get the entire HTML string besides using WebClient dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('a03effd001a04a97974607676448adbc')
VIEWS ON THIS POST

167

Posted on:

Monday 8th October 2012
View Replies!

getting recordcount -1

Hi , I keep getting -1 record count. Though I have 2 records on my table. Here's the code : Option Explicit Dim rs As ADODB.Recordset Dim con As ADODB.Connection Private Sub Form_Load() Set con = New Connection con.ConnectionString = "DSN=dbtest;" con.Open Set rs = con.Execute("select * from tbltest", adUseClient) MsgBox "Here is the record count " + Str(rs.RecordCount), vbInformation, "Test" thank you for any advice. dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('eb602b5a7f7e4da8bea63ce20e419332')
VIEWS ON THIS POST

113

Posted on:

Tuesday 9th October 2012
View Replies!

getting path and name of current Access program

Does anyone know of a way in Access XP, probably using Visual Basic code, to get the path and name of current Access program that is open Basically, I am looking for something like "currentDB", which will tell me the path and name of the database which is currently open. But I want something like "currentAcc" to give me "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE". This is obviously unnecessary if Access is always intalled in the same directory, but that is unfortunately not always the case. The Microsoft help file mentions something on MACs running OS 7.0 or higher, but nothing for PCs.
VIEWS ON THIS POST

297

Posted on:

Friday 12th October 2012
View Replies!

Combo box not getting focus

Hi I have this code in the Word Macro Code: Private Sub TextBox1_Enter() If cmbProjectCode.Text = "Select the Code" Then MsgBox "Select the appropriate Code", vbCritical, "Project Code" cmbProjectCode.SetFocus End If End Sub Private Sub UserForm_Initialize() cmbProjectCode.AddItem "1234" End Sub Default value of combo box is "Select the Code" Now, when I dont enter anything in the combo box cmbProjectCode and press Tab, I get the error message "Select the appropriate Code", but the focus in not set to cmbProjectCode but the second text box Text2 Can someone help me out
VIEWS ON THIS POST

130

Posted on:

Friday 12th October 2012
View Replies!

Input not getting complete text file

I am using an Input statement to retrieve a text file (actually a PDB file from my Palm saved on syncing the device). I wish to parse it in my vb app. I am only getting the first 15 chars. up to a hex A6 character. Any thoughts on how I can retrieve the whole file.
VIEWS ON THIS POST

260

Posted on:

Friday 12th October 2012
View Replies!

WebClient.DownloadString not getting the whole HTML string

I've searched everywhere and can't find a solution for this. I'm working on a project that scrapes data from government websites. I've noticed that whenever I use WebClient it doesn't always get the whole HTML code. Even when I get the robots.txt file it doesn't return everything. For example, http://www.bbc.co.uk/robots.txt has 80 lines but I'm only getting 13 lines. If an HTML block uses "display: none" in the style I can't get anything between the hidden HTML blocks. Here is the sample code I'm using: Imports System.Net Public Module Common Public Function GetPageHTML(ByVal strURL As String) Dim objClient As WebClient = New WebClient() Dim strReturn As String = String.Empty Try objClient.Headers.Add("Cookie", "CommunityServer-UserCookie") strReturn = objClient.DownloadString(strURL) Catch ex As Exception Throw ex End Try Return strReturn End Function End Module Is there any way I can get the entire HTML string besides using WebClient dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('a03effd001a04a97974607676448adbc')
VIEWS ON THIS POST

227

Posted on:

Saturday 13th October 2012
View Replies!

Need help getting the output

I got everything else coded well enough to get it to compile but I can't seem to figure out the output line. Public Class btnExitForm Dim strName As String Dim sngWages As Single Dim sngHours As Single Private Sub btnName_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnName.Click strName = (txtName.Text) MessageBox.Show("Okay! Now enter the hourly wage for this student worker!", "Results", MessageBoxButtons.OK) End Sub Private Sub btnWages_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnWages.Click sngWages = CSng(txtWages.Text) Select Case sngWages Case Is < 7 MessageBox.Show("Minimum wage is $7. Please enter a value over 7!", "Results", MessageBoxButtons.OK) Case Is >= 10 MessageBox.Show("Hourly wage for this position must be less than $10. Please enter a value less than 10!", "Results", MessageBoxButtons.OK) Case Else MessageBox.Show("Now enter the hours worked!", "Results", MessageBoxButtons.OK) End Select End Sub Private Sub btnHours_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHours.Click sngHours = CSng(txtHours.Text) If sngHours > 20 Then MessageBox.Show("Student workers are only allowed 20 hours per week.", "Results", MessageBoxButtons.OK) Else MessageBox.Show(" factors are verified. Please click Calculate wage!", "Results", MessageBoxButtons.OK) End If End Sub Private Sub btnCalcWage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalcWage.Click Dim sngWagesCalc As Single sngWagesCalc = sngHours * sngWages txtWageProd = "strName "&"Wage: "&sngWages" &Hours worked: &"sngHours" &Total Wages: "&sngWagesCalc End Sub Private Sub btnClearForm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClearForm.Click txtName.Text = String.Empty txtHours.Text = String.Empty txtWages.Text = String.Empty txtWageProd.Text = String.Empty End Sub Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
VIEWS ON THIS POST

278

Posted on:

Saturday 13th October 2012
View Replies!

Need some help getting started

: It has been years since I've done any VB programming and hoping to get a kick start. Basically my end goal is to create a new file based on a master file that contains static data. The program will add the data to the end of the static file. The user would select the new file name. I would really appreciate the code/basic form to allow a user to select the master file and a routine that will copy (write) the data to a new file named by the user.
VIEWS ON THIS POST

168

Posted on:

Saturday 13th October 2012
View Replies!

Problems getting keydown to work.

Im having troubles getting Keydown to work in VB6. I require that when the keys are pressed that the program call and execute a module of code. at present when i click any of the arrow keys (the ones i most require) the program just moves the button highlight to another button. Here is the code i am using so far. Code: Private Sub Form_Keydown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyRight: Call RightBoundary Case vbKeyLeft: Call LeftBoundary Case vbKeyUp: Call Rotatedefine Case vbKeyDown: Call ShapeDownMove Case vbKeySpace: Call Pause End Select End Sub
VIEWS ON THIS POST

173

Posted on:

Saturday 13th October 2012
View Replies!

Webbrowser getting dropdown stuff

ASP.NET Blog |\t VB.NET Forum | Post Points: 5 stealthrt Since 9/19/2003 Posts 127 Reputation 1,655 Reply David G (stealthrt) replied on 3/9/2007 9:55 PM rated by 0 users Does that place all the items in the dropdown box of the website into a dropdownbox on the VB formDavid
VIEWS ON THIS POST

190

Posted on:

Saturday 13th October 2012
View Replies!

New to excel and getting a runtime error 1004

Hi I'm new to excel and am trying to create a maintenance "database" that will update the dates that maintenance is to be done by the date today. Some of the things will be done weekly/monthly/yearly. I keep getting a runtime 1004 error when I try and use: Code: Sub weekly_monthly_yearly() ' ' weekly_monthly_yearly Macro ' Macro recorded 10/06/2004 by Shaw Resources ' ' Keyboard Shortcut: Ctrl+d 'change dates at the start of a new week If (Sheet1.Cells(5, E).Values Like "Weekly" And DateDiff("d", Now, _ Sheet1.Cells(5, H).Values) >= 1) Then 'if its monday If (Weekday(Now(), vbMonday)) Then Sheet1.Cells(E, 5).Values = Sheet1.Cells(5, E).Values + 7 'add 7 days to schedule 'if its tuesday ElseIf (Weekday(Now(), vbTuesday)) Then H = Now() + 1 'if its wednesday ElseIf (Weekday(Now(), vbWednesday)) Then H = Now() 'if its thursday ElseIf (Weekday(Now(), vbThursday)) Then H = Now() + 6 'if its friday ElseIf (Weekday(Now(), vbFriday)) Then H = Now() + 5 End If 'if its monthly maintenance ElseIf (E = "Monthly" And Month(Now()) > Month(H)) Then 'add a month to date H = Month(H) + 1 'if its yearly maintenance ElseIf (E = "Yearly" And Year(Now()) > Year(H)) Then H = H + 365 End If End Sub I can't seem to get by the error. I know there's a lot more I have to do like change all the E's and H's to actual data but I can;t figure out how to call on the data without the error popping up.
VIEWS ON THIS POST

172

Posted on:

Saturday 13th October 2012
View Replies!