Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Reading Values From A Flexgrid


Hi.

Can anyone tell me how i would go about reading values out of a flexgrid to get them into my print setup.

All i need is to ba able to lop through the flexgrid and read the values.

I use the following code to fill it, just nto sure how to read it.

Cheers
B.

'Open "c:ankings.dat" For Input As FileNum
Do While Not EOF(FileNum)
Input #FileNum, datebanked, Calculated, Actual, Statement, OverUnder
tmp = Replace(datebanked, "#", "")
If CDate(Trim(tmp)) >= startdate And CDate(Trim(tmp)) <= endDate Then

'Loop through the site bankings file till the end.
' msf2.AddItem datebanked & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Statement & Chr(9) & OverUnder
' frmDocument.msf2.AddItem tmp & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Statement & Chr(9) & OverUnder
frmstatement.lstbankings.AddItem tmp & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Chr(9) & OverUnder
' add your code here !!
' MsgBox "hello"
End If
Loop
Close #FileNum




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Superimposing Textbox And Listbox In A Flexgrid To Enter Values In Flexgrid
Hi,
    I had done a project(VB6) where I placed a textbox in flexgrid to enter data in flexgrid.After that I tried using textbox and listbox to enter data.When i press a key(FlexGridKeyPress Event) the textbox is made visisble in the current cell of flexgrid.the listbox is filled with values, so that when i enter data in textbox,listbox will be made visisble just below textbox appearing as if it is a combobox and depending on the values i enter in textbox the listbox scrolls up (if there is matching text entered in textbox) and by using arrow keys(keyboard) (event :- txtKeyDown event, kCode:-keycode=35)
i should be able select a value from listbox and the selected value(if selected) should be
displayed in the textbox.After that on enter key press (Keyascii=13) the textbox and
listbox should be made invisible(visible=false) and either the selected value from listbox or any text I enter in textbox should be displayed in the current cell of FlexGrid and after that focus should goto next cell same row in the flexgrid.I was able to bring the text box and listbox in the proper places but could not do the rest.Please can u give me
the solution with source code




Edited by - sanththomas on 7/7/2002 6:49:21 PM

.ini File Creation/reading Values/modifying The Values
Hi i would like to store some values in a form and retrive when ever required. i would also like to modify them at runtime.
so i am thinking of using .ini file.
Help me in this regard.
Is there any other way to read/write/modify values faster?

Values From Flexgrid
I have a flexgrid, when the user highlights a row and clicks the delete button I remove the row, but before I remove it I want to run an ADO command object to delete the row from the database.
My only problem is, how do I get the value of the first col of the selected row (the ID of the row) so I can use it in my where.
I`m sure it`s very simple, but I`m a noob and it`s late
Thanks.

How Do I Add Up All The Values In A Particular Column Of A Flexgrid??
Ok im using a data control and an SQL query to pull certain data from a table. once ive got it into the flexgrid, how do i tell vb to add up all the values from a particular column, ie column 0 or 1 or 2 etc etc


also i want to store this total to the caption of a label, so the code would be something like



Code:
label1.caption = xxxxxxx


where xxxxxx is the code adding up the data from a flexgrid column

Printing Flexgrid Values
Hello All,

I need to be able to print out the cell values of various grids. All I can get is the last value, i.e. bottom right. I tried to place the grin into a Picturebox but then got nothing.

Yur help would be appreciated.

Thank You
Tarablue

Adding Of Row Values For Flexgrid
Hi, I need to add the values of 2 rows to get a total value. The flexgrid should show something like this ---->

=======
may::01::
=======
Mar::03::
=======
Total::04
=======

I cant get the total value direct from the database as my "total" may contain blanks which might affect the the "total" shown on the flexgrid. (Blanks due to lack of maintanence by admin )

I was wondering if flexgrid might allow me to add two row of values together to get a total. Can someone advise me on this thanks.

==============================================
VBCodes which Im using to get the row values
==============================================

'Set for AR
'Row1
sql = "SELECT count(*) as AR1 from EmpExit " & _
"Where (XRSN01 = '1' AND " & _
"XDCODE = 'A AR' and " & _
"XLYYYY = " & selectedyear & " - 1 and " & _
"XLMM >= 6) OR (XRSN01 = '1' AND " & _
"XDCODE = 'A AR' and " & _
"XLYYYY = " & selectedyear & " and " & _
"XLMM <= 7)"

rscount.Open sql, cn, adOpenKeyset, adLockOptimistic

MSF1.Row = 1
MSF1.Col = 1
MSF1.Text = rscount.Fields("AR1")

rscount.Close

'Row2
sql = "SELECT count(*) as AR2 from EmpExit " & _
"Where (XRSN02 = '1' AND " & _
"XDCODE = 'A AR' and " & _
"XLYYYY = " & selectedyear & " - 1 and " & _
"XLMM >= 6) OR (XRSN02 = '1' AND " & _
"XDCODE = 'A AR' and " & _
"XLYYYY = " & selectedyear & " and " & _
"XLMM <= 7)"

rscount.Open sql, cn, adOpenKeyset, adLockOptimistic

MSF1.Row = 2
MSF1.Col = 1
MSF1.Text = rscount.Fields("AR2")

rscount.Close

Adding Values Into A Flexgrid
can any one tell me how you can add items into a flexgrid dynamically. e.g. everytime the user enters a value from a input box, the value will go into the flexgrid

Many thanks in advance

Read Values From Flexgrid
Hi.

Can anyone tell me how i would go about reading values out of a flexgrid to get them into my print setup.

All i need is to ba able to lop through the flexgrid and read the values.

I use the following code to fill it, just nto sure how to read it.

Cheers
B.

'Open "c:ankings.dat" For Input As FileNum
Do While Not EOF(FileNum)
    Input #FileNum, datebanked, Calculated, Actual, Statement, OverUnder
    tmp = Replace(datebanked, "#", "")
      If CDate(Trim(tmp)) >= startdate And CDate(Trim(tmp)) <= endDate Then
  
 'Loop through the site bankings file till the end.
   ' msf2.AddItem datebanked & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Statement & Chr(9) & OverUnder
' frmDocument.msf2.AddItem tmp & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Statement & Chr(9) & OverUnder
 frmstatement.lstbankings.AddItem tmp & Chr(9) & Calculated & Chr(9) & Actual & Chr(9) & Chr(9) & OverUnder
         ' add your code here !!
        ' MsgBox "hello"
      End If
Loop
Close #FileNum
 

Add New Text To Existing Values In Flexgrid
Hi,

I have a flexgrid which is currenty populated with values, is it possible to add new text to a cell without losing existing values? The new text comes from a text box.

I have tried to do this, but always overwrite the value in the cell

Regards

Recognizing FlexGrid Values Across Forms
Form1 has a FlexGrid installed, Form2 a Command Button that on execution accesses data within the Form1 FlexGrid. Execution yields an "Object Required" relating to the FlexGrid. Not sure what to do with this. Any help would be appreciated.

Thanks

k483

Passing Values From Flexgrid To Textbox
I have code to add total of a column in a flexgrid. The amount in the flexgrid are formated to "#,###,###.00" the reason is i am working with high numbers in millions so i need for it to be like that when the total is displayed in a textbox. How can i keep the format from flexgrid to textbox and also be able to transfer decimals etc keep the original number that is inserted into the flexgrid.???

Null Values Inside Flexgrid
I have a flexgrid in it i have 4 fields. field1 is name, field2 is location and field3 is quantity and field4 is price per unit, then in field 5 is the total. Unfortunately i dont have all the details with me all the time so i would like to be able to add null values into a fiels and still be able to continue on. I have tried all i get is error 13 please help me.Thanks

Color FlexGrid Entries Between Certain Values
Hi to All!

This code works for a number > than 5.

How must it look if the value is between 2.0 and 5.0?

I cannot get my syntax right to exclude values less than 2.0.

Please help!

Private Sub Data1_Reposition()

Dim i As Integer

For i = 1 To MSFlexGrid1.Rows - 1
MSFlexGrid1.Col = 2
MSFlexGrid1.Row = i
If CCur(MSFlexGrid1.Text) > 5 Then
MSFlexGrid1.CellForeColor = vbRed

End If

Next i
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0

End sub

Trim Values During Flexgrid Addition
Can anyone tell me. If i'm using the below code to read columsn in a flexgrid, how do i get it to add the values even if they have $ and , in them. The columns are formatteed into currency, with the seperators it cant add them. If i edit out the format seperators it works fine.

Can anyone tell me how to modify this code to remove the $ , before adding the column?

my code is as below.



Function RunningTtl() As Long
Dim x As Integer
Dim RT As Long
RT = 0
With frmDocument.msf1
.Col = 2 'move to column being summed
For x = 1 To .Rows - 1
.Row = x
RT = RT + Val(.Text)
Next
End With
RunningTtl = RT
End Function

Update Flexgrid With Listbox Values
Is there a way to populate a flexgrid table so only the fields whose names are indicated within a listbox get populated in the final flexgrid. I basically have a table with many fields but I want to limit the fields that show up based on a previous selection.

Thanks in advance!

Loading Values From Database To VS Flexgrid....
How to load values from Access database to VS Flexgrid .
How to refresh values in flexgrid
How i go...anyone pls guide

Retrieve Values From A Hierarchical FlexGrid
Hello all;

For the first time, I am exploring the Hierarchical flexgrid control. Much to my surprise, I have not yet found a way to retrive values from a row when the user clicks on a given cell. Also, is there a way to prevent the user from selecting multiple rows? Thanks,

DA

FlexGrid And Checkboxes (boolean Values)
Can you put a checkbox in a boolean column in a FlexGrid? If not, is there any other Grid structure (non 3rd party), that supports this, as well as databinding?
TIA,
Andrej



Edited by - Andrejko on 6/18/2002 12:45:14 PM

Flexgrid Does Not Display Integer Values
MSFlexGrid1.AddItem CStr(myRecordset.Fields("OrgName").Value)

The above line of code does not do what i thought it will do.
Following is what i am trying to solve.
on my Form i have a MSFlexgrid which gets its values from the Access database. This grid shows a blank row if the value in the row begins with integer or varchar that starts with an integer. could someone please tell me how i can make something like following appear in the flexgrid row. thanks.
123 Durham St

If the value is "Durham St 123 Apt 1" it is displayed in the flexgrid. But if the value is "123 Durham St Apt 1" it is NOT displayed in the flexgrid.
I have been trying to figure this out for past few days and an really frustrated now as i am approaching my deadline. could someone please help me fix this. thanks alot...Please help.

Extract Values In A Flexgrid Of A External App.
I need some help about how to collect data from a external application
which has a MsFlexgrid control.

The full story is:

I have a streaming data (3rd party app) system that was developed in VB(activeX, it is a OCX) and
it is loaded in a IExplorer screen). The collected data (in real time) is
displayed in a flexgrid in IE screen.

I would like to access the data (only read a cell !!!) in these
flexgrid, so I would write another external program in VB to display charts
or perform some statistics based on those data.


Can someone me ?

Thanks in Advance.
 

Filtering Values From FlexGrid On Browser
Hi all,
How do i filter out values from a Flex grid control which is on the browser onto an asp page?
For eg: I have made an Active X control and have included it into an HTML Page(assume x.html) by using the &lt;OBJECT&gt; Tag.. Now on submitting this
page (x.html) to a page (y.asp) how can i read the contents of the grid since i am unable to pass the grid using neither the GET nor the POST method ????

Any takers ???

Thanks u've been of great help

Regards
Ashvin

Reading Value From Text To Flexgrid
Hi All;
I'm using flexgrid to get data from user but i want also reading data from text. For example user will prapare text like below

nm=3 'number of x y z data
0 0 4
4 0 4
0 3 4
nl=2 'number of line
1 2
2 3

now i will get this data from text and put into flexgrid. How can i do this ?
Thank you
Levent

Reading Value From Text To Flexgrid
Hi All;
I'm using flexgrid to get data from user but i want also reading data from text. For example user will prapare text like below

nm=3 'number of x y z data
0 0 4
4 0 4
0 3 4
nl=2 'number of line
1 2
2 3

now i will get this data from text and put into flexgrid. How can i do this ?
Thank you
Levent

Capture Multiselected Values Of A Column In A Flexgrid
I have a flexgrid of dates. I would like the user to select one or more records. I then want to get the value of the dates they have selected.

This is simple if they click on one row at a time. I think I could use Keypress to capture the shift and select a range, but I was hoping there is an easier way since the flexgrid will let you multiselect rows.

How To Display The Flexgrid Columns Values According To The Text
Hai friends,

   In my project, i am using Flex grid. I am adding, display(Form load, search) the description Text in the Flex grid.

    What i am in need of is, when the user searches the particular record, i want to show the whole description text in the flex grid. My description is in Column 2. I want to view all the text in that column 2. how to manipulate that.

   So far, when the user searches a record, its display in the flex grid looks( see the attachment "SearchDisplay.jpg")

  how to increase the width of the flexgrid according to the text dynamically

help needed    

Regards

Geetha

Deleting A Block Of Values In A Flexgrid Like You Would In Excel.
If i have a flexgrid with columns A to Z and Rows 1 to 10. How would i delete ( ie make null) a block of values for instance
colums P to Z ,rows 7 to 10. In excel you highlight them and press delete.

In my program you block them in and press the Delete button but could anybody point me to the type of code i need. What properties of the flexgrid would identify the values highlighted?


Mark B

Reading Cellbackcolor Problem In Flexgrid
I’m having problems reading the CellBackColor of a flexgrid in certain situations.

If I’m using the click event on the grid, I am able to read the color
    ex. If MSFlexGrid1.CellBackColor = vbRed Then
        ‘this will return true if the cell clicked is red

However when I try to reference by a certain row and column, it always returns false and the CellBackColor is always 0.
     With MSFlexGrid2
        .Row = 1
        .Col = 0
        if .CellBackColor = vbRed then
    ‘this is always returning false

Any ideas on how to do this?

Thanks in advance,

Jim


Reading Reg Values
Hi,
I'm using VB 6.0. How would I read a certain registry value?

Reading Values
My commandbutton1 is placed in my spreadsheet, by click, TextBox1 in Userform2 should get value from Cells(3,2). UserForm2 should be shown.

My problem is TextBox 1 remain emty.





Code:

Private Sub CommandButton1_Click()
Sheets("Lineconfig").Activate
UserForm2.TextBox1.Text = Cells(3, 2)
UserForm2.Show
End Sub

Reading Hex Values
ok im reading hex values from a text file and want to set them as the back color. i hope you can follow my messy code


VB Code:
MainForm.ccard1.BackColor = Cint(ReadFromFile("C:Documents and SettingsB TurnerDesktopGenMayproptery.txt", 3 * Loc))  Public Function ReadFromFile(path As String, lines As Single) As StringOpen path For Input As #9For ii = 0 To lines    Input #9, currentlineNext iiClose #9ReadFromFile = currentlineEnd Function


but this causes it to over flow, and even if it didnt overflow it still wouldnt work because hex values arent integers. So how can i change this string into a hex varible to put into backcolor?

Can't Display Saved CheckBox Values Upon Clicking A Row In FlexGrid!!Help
I have this problem where my program can't show the saved CheckBoxes when I click a row in the MSFlexGrid. I've included an image below:



You can see that, no 'checked' are being displayed in the chkbox section, although i've 'checked' some of it and save the record. No problems with the textfields. only the checkboxes. Anyone who knows how to retrieve the checked values from the MSAccess file, and upon clicking a row in FlexGrid, it will display which are checked and unchecked boxes for each row in FlexGrid?? thanks in advance to those who are wiling to help me.

Add New Text To A Flexgrid Cell Without Overwriting Existing Values
Hi,

I have a flexgrid which contains existing values in each cell. I want to be able to add new text to each cell without losing these initial values. I have tried a number of approaches, but all overwrite the existing text. Can anyone tell me if this is at all possible, and if yes, how I would go about it?

Adding Nulls Values Or Blank Spaces Into Flexgrid
I have a flexgrid in it i have 4 fields. field1 is name, field2 is location and field3 is quantity and field4 is price per unit, then in field 5 is the total. Unfortunately i dont have all the details with me all the time so i would like to be able to add null values into a fiels and still be able to continue on. I have tried all i get is error 13 please help me.Thanks

Sorting A Flexgrid (string Values But Formatted As Date)
I would like to sort the rows in Flexgrid by date, but my dates are string values formatted in "YYYY-MM-DD". I use the following code

  flgEventCalendar.Col = 1 'Column to be Sorted
  flgEventCalendar.Row = 1 'From Row number
  flgEventCalendar.RowSel = flgEventCalendar.Rows - 1 'To Row
  flgEventCalendar.Sort = 2

(flexSortGenericDescending 2 Generic Descending. A descending sort, which estimates whether text is string or number, is performed. )


But this does not work properly when I have different years. For vales with the same year everything works OK (descending) But if I have 2005-01-01 comes above 2004-01-01 which I do not want.

ex. I want to have 2004-02-10
    2004-10-10
    2005-01-01

Is it possible?

FlexGrid: Setting && Reading Block Size
If there a way to determine the number of rows (and/or columns) selected by the user (ie block mode)? I've figured out a clunky way by looking at the cell's backcolor to see if they are BackColorSel or just BackColor (to do this I set AllowBigSelection = True and SelectionMode = flexSelectionByRow). But I figure there must be a better way.

And how about the opposite: is there a nifty way to have cells appear as if they've been selected via the mouse other than by explicitly setting the cell's BackColor?

I guess I'm looking for properties that might be called RowBlockStart, RowBlockEnd, ColBlockStart, ColBlockEnd.

Thanks!

Reading After Separator Values HELP
Hi There,

Having real vb6 problems here, pretty much gone brain dead on this one...HELP

heres the jist:

I have a text file with Following values:

Forename=John
Surname=Smith
Learnercode=NX01ABCD

I have a form with three text boxes and need to place only the info into the text box eg.

text box1 has just John in it
text box2 has just Smith in it
text box3 has just NX01ABCD in it

in other words it does not read the header info from the strings - Forename= , Surename =, Learnercode=

are you with me?
Can you help......

Reading JPEG RGB Values
Hello;

I've done quite a bit with VB6 over the years, but I've never played with graphics. I need to read JPEG files and evaluate the quantity of "red" in images. I think I could handle this if I knew how to open/read JPEG files and examine the RGB values for each pixel.

Anyone have any suggestions, or tools I might utilize with VB for this purpose?

Thanks!

Reading And Writing Hex Values
I'm using an ADO connection to connect to a SQL 7 database. I then execute a query along the lines of: select encrypt('select 1')

This then returns an encrypted string. If I execute this in SQL Query Analyzer I get the correct encrypted hex values back. But if I use the recordset to return the values it comes out as: ???????????

Any idea how to fix this and return the correct hex values? I also have to write these values to a file.

Reading List Box Values
Does anyone know how to go about saving the values in a list box into a table?

I've used code that Timbo (I believe) posted to move entries in one list box to another when they are double clicked. However, I'd like to take these selected items and save them in a table so that they can be queried / used elsewhere.

I'm as new to VBA as someone could possibly get, so any help would be greatly appreciated.

Cheers

Phil

Combobox Reading Values To
I have a questions about how one would read the value that was chosen from a combobox and have that value written to another worksheet.

This is how I am populating the combobox when the worksheet activates.

[vb]
Private Sub Worksheet_Activate()
'test
amt1.Clear
amt1.AddItem ""
amt1.AddItem "$0"
amt1.AddItem "$350"
amt1.AddItem "$500"
[/vb ]

What I need to do is to take what is selected from the combobox above and copy that value to another worksheet into a specific range. If anyone knows how to achieve this that would be great!!. I have looked through the threads and found out how to count a list box, read from a database etc but nothing, unless i didn't look far enough into the threads, about how to write the value out. Thanks for any help anyone can provide me.

Reading Values From The Registry
Hi,

I'm currently making an add on application for Diablo2 that allows fast switching between various mod packs that are available for the game. One of the things I want to do is give each game a separate save path, to do this I need to read and write values to the windows registry.

in VBS I can use
Shell.RegRead("HKCUSoftwareBlizzard EntertainmentDiablo IISave Path")

but the RegRead method isn't available in VB6... so I have tried playing around with the GetSetting command.

Using this in the debug window:
? getsetting ("Blizzard Entertainment", "Diablo II", "Save Path" )

returns an empty string, even though I know it has a value in it (I can see the value using regedit.

Obviously, I have some of the syntax wrong or I'm doing something silly. Please help me!

Cassie

Reading REG_BINARY Values
when i read reg_binary values from the registry the values i get returned arent the ones that i see through regedit.

I've definitely got the right correct subkey and value name and i've debugged as far as to know that it knows its reading a reg_binary value.

The value i see in regedit is in HEX form :

63 33 46 31 61 58 4a 79 5a etc


but when i used this code to read it i get :

13175

I'm thinking its something to do with the strData variable being declared as an integer. But how can i fix it? I've changed it to a long variable and i get this returned:

826684259

if its a string i get errors.

So how do i get what i want to see?

Here's the code: (just the standard code taken from allapi.net)


Private Function RegQueryStringValue(ByVal hkey As Long, ByVal strValueName As String) As String
Dim lResult As Long, lValueType As Long, strBuf As String, lDataBufSize As Long
'retrieve nformation about the key
lResult = RegQueryValueEx(hkey, strValueName, 0, lValueType, ByVal 0, lDataBufSize)
If lResult = 0 Then
If lValueType = REG_SZ Then
'Create a buffer
strBuf = String(lDataBufSize, Chr$(0))
'retrieve the key's content
lResult = RegQueryValueEx(hkey, strValueName, 0, 0, ByVal strBuf, lDataBufSize)
If lResult = 0 Then
'Remove the unnecessary chr$(0)'s
RegQueryStringValue = Left$(strBuf, InStr(1, strBuf, Chr$(0)) - 1)
End If
ElseIf lValueType = REG_BINARY Then
Dim strData As Integer

'retrieve the key's value
lResult = RegQueryValueEx(hkey, strValueName, 0, 0, strData, lDataBufSize)
If lResult = 0 Then
RegQueryStringValue = strData
End If
End If
End If
End Function



Thanks for your help

Reading REG_MULTI_SZ Values
Hi,
I want to read a registery info that is in format of REG_MULTI_SZ.
WScript.Shell works fine to read the value. However, it cannot be assigned to string value. cstr does not make the variant a string.

Which type do I have to use?
More importantly, How can I convert the "variant" into a "string"?

Thanks for your help?

Reading Values From Forms
I need to read different values from text boxes in froms to the program where the values will be used. I need all of the text boxes to have a default value that show up everytime you run the program but of that which you can change. Can you please show me how to do this?

Also how do you read values for public variables in the program is there is a different method for that than those that are just declared in different subroutines?

Thanks guys!

Reading Values From Files
Hi is there anyway to read a value from 2 files, add them up and display the answer in a textbox.

Reading The Different Values Of A VB Cell
hello

Is there a way that i can read the different values in an excel cell?

what i mean is say i have a cell B12 and it has three values

white, green, blue

which i have populated using the

data --> validation --> list

can i read those values using the VB program using a variation in the command


Code:
colorName = ptrexcelcolor.Worksheets("colors").Cells(12, 2)

Reading Values From Excel
Hi,
can i get any sample program to read values from excel using a VB program?

thanks and regards
vivek.s

Reading Values From A Recordset??
Hi ,
I have a Recordset something like this

Set rstDescription = db.OpenRecordset("SELECT [StrPrimaryAttribute]&" = "& [StrValue] FROM tblTempWindsorOrder WHERE IntId =" & Itemnumber)
My Q is how to store the values that this select statment will return ,in a Variable since this will return more than 1 value .
I am using a DAO Access Databse...any suggestions will be helpful.

Thanx
himangi

Reading Registry Values For IE In VB (was: Where Is It???)
I am making a web browser in VB 6.0, and I need to know where Internet Explorer stores its options . What I mean is where is the file or registry key that contains things like the current home page, or bookmarks.

All help will be grately appreciated.
(and maybe I'll put a special thanks in the credits for any help)

Copyright 2005-08 www.BigResource.com, All rights reserved