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




Sorted ..... Combining A Textbox And A Grid?


How can I combine a textbox and a grid? I have a database of customers, i.e. Customer_Name; Address1; Address2; Address3; etc. which are displayed in the grid. There may be 10 Customers of the same name but all have different addresses. What I want to be able to do is allow the customer to enter the first letter of the name in the textbox and the grid scrolls to the associated letter, if the user enters the first 2 letters of the name the grid scrolls to the associated name, etc. Much the same as a combobox.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Combining Textbox && Grid
How can I combine a textbox and a grid? I have a database of customers, i.e. Customer_Name; Address1; Address2; Address3; etc. which are displayed in the grid. There may be 10 Customers of the same name but all have different addresses. What I want to be able to do is allow the customer to enter the first letter of the name in the textbox and the grid scrolls to the associated letter, if the user enters the first 2 letters of the name the grid scrolls to the associated name, etc. Much the same as a combobox.

MailMerge - MS-Flexie Grid [SORTED]
i am trying to make a mail merge between vb6 and word (i got some example and will be working on them soon)

the problem is that i am planning to use a replacing function (make a word template and then make the program to replace <cAdd> with the clients address and so fort) but i need to add a list of products which the client has purchased, this list is in a grid format in the program but i have no idea on how to transfer the grid contents to the word file since there can be a X amount of products

so how can i transfer a whole grid to word and then print it?

Isometric Grid Sorted - One Small Problem
Using help from examples on this site and others ive finally got my isometric map editor working. I just figured out the major problem was registering the coordinates in the grid which the mouse clicked. With that sorted i discovered a problem - im not sure of its extremity because im not sure how hard it is to fix. My grid is set out like this:
Now (0,0) shood be here: |
.....................................V

.....................................^
...........................y...../........x
.............................../..................Instead, the x is back to front. (0,0) is
............................/........................at the left corner. X basicly just
............................................./......starts its 'coordinate count' from the
.........................................../..........wrong end.
........................................./
......................................V
(dots are for formatting)
Here is the code that determines where to place each tile according to its coordinates - mind you, in the coordinates, (0,0) IS the top corner


Code:
xpos = ((Form1.Width) / 30) - (Universe.MapX * 36) + ((Universe.MapY - 1) * 36 + (a * 36) + (b * 36))
ypos = (Form1.Height / 30) - ((Universe.MapY - 1) * 18) - (Universe.MapX * 18) + (b * 18) - (a * 18)
'xpos and ypos are where the uppermost left corner of each tile is pasted
'my tiles are 72X32, hence the 36s and 18s
'MapX and MapY indicate what part of the map is currently on the screen
I think this is all of the code you need. I admit that i myself dont fully understand the code there, i took it from a tutorial and modified it to my needs. Each tile fits perfectly, everythings perfect.. except for the inverted x. Any help would be apreciated. Thanks

Showing 2 Tables In A Single Grid.(sorted)
hi all
i've 2 tables and both the tables have a date field. i want to show the rows from both the tables in a single grid sorted according to the date. what is the easiest way to do this( i'll be happy if some sql statement can be used.)

Copy Text File Into Data Bound Grid In A Sorted Order?
I have a text file and i need to move its contents to DB Grid .
For Eg.
following is my test.txt

ravishah885 kent confirmed posted
ravi_sarla lamar pending
kent8541932 NCSU pending
kent8541933 ohio pending
kent86541934 northcarolina confirmed posted

for each line , I want "ravishah885" to be stored in one cell,"kent" in other ,"confirmed" in third cell and "posted" in fouth cell.
After storing all values i need to sort it in Data bound grid.

please mail me ASAP .
Thanx
ravi

 

DAta Grid Using Adodc Control Doesn't Display Sorted Record Why?
Please Help me any coding suggestions...I have a datagrid using AdodcControl as a datasource cant display sorted record but instead the record is jumbled every time I load the form...I have tried using an SQL statement with Order BY [FIELD] ASC but still it wont work...Please can somebody help me about this problem...Thanks...

Sorted ... I Think!!! ---&gt; Allow User To Tab In A Multiline Textbox
How can I allow my user to tab (for indentation) in a multiline textbox? At the moment, if the user tabs the textbox looses focus the next component is given focus.

TextBox Change Events - Combining Lots Of Them To One?
Hi! I got a form with lots of textboxes on it, 22 to be precise. I want to catch the change event for everyone of them, which is easily done by repeating my code 22 times, however, I'd like to know if there's a more elegant or easier to read way to do this. Here's a short code example:


VB Code:
' my event handler to call change event functionsPrivate Sub firstTextbox_Change() ' tell change event not to trigger on form_loadIf gbolLoadingForm = True Then Exit Sub ' save the name of the textbox to an arrayCall remember_ThisHasChanged("txtfirstTextbox") end sub


Now, 'cause this is no really complex set of lines of code, isn't there a way to wrap the whole 22 events into something like a select-case sonstruction?

thx for reading, time & replies,
eugen

Check To See If Array Is Sorted Or Nearly Sorted
What is the quickest way to tell if an array is sorted or nearly sorted?  Thanks in advance.

Swi

Sorted Listbox Not Sorted (VB6)
In VB6, SP6, I created a listbox, set "Sorted" to True, and in the form_load event, I put this:

list1.additem "a-b" (with a dash or hyphen)
list1.additem "a_b" (with an underscore)

VB seems determined to put the underscore BEFORE the dash, but the ASCII code for the underscore is HIGHER than for the dash. I searched several places for things like "vb6 listbox underscore sorted", and could not find anything.

Is this a known problem? Is there a workaround, or should I just keep re-sorting the box in code?

Thanks in advance,

Larry

Grid That Looks Like A Textbox
Hello There,

I need to open a text file using some kind of a grid...I need each cell to contain one letter..and it must look exactly like a textbox

I have tried MSflexgrid but the letterss are far from each others and it doesn't look nice, even when the grid lines were = 1 (and with no grid lines)... still it doesn't look nice..

I need the grid so I can select a "block" (rectangle) of text and not lines...

P.S. in cmd.exe the select is done by blocks, but in any other application it is by lines...

Any suggestions?

Thanks in advance...

Textbox In Grid
Hi,

Will some one tell me how to embed a text box in the
MS Flexigrid. I remember having seen the code in an
example sometime back.

Please provide me the link if any one has any idea
where it is stored.

cheers,

TextBox In MSHFLEX GRID
Hello,
I have a table item it has 3 field code name qty
it is connect with adodc and flexgrid wht i want is
if my focus is on code it display a textbox in cell and then
when i pressed tab or enter it display in name then
qty


plz help me
regards

Textbox/combobox Within Grid Control
I am trying to make a MSFlexGrid contorl editable by placing a textbox and combobox within the grid....My problem is that I can't get the textbox/combobox to line up within the designated cell. Any ideas?

Thanks,
Blake

Search XML File And Display Result In A Grid Or TextBox
Hi,
I have an XML file that looks something like this extract..

<?xml version="1.0" encoding="UTF-8" ?>
<MainRequest>
<cust id="010015000002/2053137DRV">
<ref>205313794V</ref>
<Date>20051231</Date>
<firstName>CATHY</firstName>
<middleName>SUE</middleName>
<surname>PATTERN</surname>
</cust>

<cust id="010016000001/2060954REA">
<ref>7060954762</ref>
<Date>20051231</Date>
<firstName>JOHN</firstName>
<middleName>BRAD</middleName>
<surname>AUXLED</surname>
</cust>

<cust id="010017000000/2051035GF">
<ref>6051035AHT</ref>
<Date>20051231</Date>
<firstName>EMILIA</firstName>
<middleName>DAWN</middleName>
<surname>HOSKIN</surname>
</cust>
</MainRequest>


This file would ultimately hold several thousand records, what I am trying to achieve is on a form have a Listbox, that would hold search criteria....eg search on surnames, or ref..etc etc. Then I wanted the search result to be displayed in a grid or at the worst in a TextBox....but, I need all of the attributes associated with the record to be displayed too!!
Any pointers would be valued.
I have plagerised the following code from this forum ...but it still needs some work to get me to my goal.

VB Code:
Dim oxmlNodeList As IXMLDOMNodeListDim XMLDoc As MSXML2.DOMDocument30Dim intIndex As Integer Set XMLDoc = New DOMDocument30XMLDoc.async = FalseXMLDoc.validateOnParse = FalseXMLDoc.preserveWhiteSpace = False XMLDoc.Load "C:Test.xml" If XMLDoc.parseError.errorCode = 0 ThenIf XMLDoc.readyState = 4 ThenDoEventsEnd IfElseErr.Description = XMLDoc.parseError.reason & vbCrLf & _"Line: " & XMLDoc.parseError.Line & vbCrLf & _"XML: " & XMLDoc.parseError.srcTextErr.Raise 1006End If Set oxmlNodeList = XMLDoc.documentElement.selectNodes("//firstName") For intIndex = 0 To oxmlNodeList.length - 1If oxmlNodeList(intIndex).parentNode.parentNode.nodeName = "cust" Or _oxmlNodeList(intIndex).parentNode.parentNode.nodeName = "MainRequest" ThenDebug.Print oxmlNodeList(intIndex).Text Debug.Print oxmlNodeList(intIndex).nextSibling.TextEnd IfNext Set XMLDoc = NothingSet oxmlNodeList = Nothing

From Form2's Grid Control's Text To Form1's Textbox Setfocus Is Not Working
Friends

Have a look and try to help me.

In the form1 place one textbox.

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF9 Then
Form2.Show
End If
End Sub

in the form2 place a datagrid or flexgrid and a datacontrol select any table just to get the values inthe grid. after that.

Private Sub DataGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Me.Hide
Form1.Text1.Text = Me.DataGrid1.Text
End If
End Sub

Try this once you press the enter key in the grid. form2 will hide and the form1 is not enabling.

i tried by giving form1.text1.setfocus etc...
but no use can anyone set a focus from form2 to form1 by using the above code.

Thanks
Sathyguy

How Do I Search Typed Data In Textbox In Data Grid Column
How do I Search typed data in Textbox in Data Grid Column

on Form load Data From Access TAbles loads into Datagrid

am having Textbox When i Typed Certain Name it should search on Selected Column

thanks
Rajesh

***SORTED***end Sub
i have a command button which takes the caption from a text box and manipulates it. i have a message box if the user dosn't enter any information. what i want, is to drop out of the procedure once the user has pressed o.k on the message box. i have the following code, its telling me i am missing an end if


VB Code:
... Private Sub CmdTransfer_Click() If TxtMsg = "" Then    MsgBox "Please enter a ten digit message in the text box", vbCritical, "Please enter a ten digit message in the text box"    TxtMsg.SetFocus    end subEnd If a = Mid(TxtMsg.Text, 1, 1)b = Mid(TxtMsg.Text, 2, 1) end sub


spider

Now That's Sorted What About This?
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Command1.Top = 240 Or Command1.Top = 640 Or Command1.Top = 1040 Then
Command1.Top = Command1.Top + 400
Else
End If
End Sub

WITH THIS CODE,EVERY TIME THE MOUSE IS PLACED OVER THE
BUTTON,IT MOVES DOWN TO THE VALUE OF 400 (240 + 400=640)
(command1.top = command1.top +400)
HOW WOULD I MAKE IT SO THAT EVERYTIME THE BUTTON MOVES,
THE CAPTION ON THE BUTTON CHANGES?(CAPTIONS SET BY ME
FOR EACH NEW POSITION)

Sorted!
I am trying to find an algorithm that will sort a field I have that stores account codes. The problem I have is that the codes have both numeric and alpha numeric data in them. Eg ABC02;ABC01;1OA29;1OA30 so the algorithm needs to be able to look at each character so that the codes are sorted in logical order. Results should be ==> 10A29;1OA30ABC01;ABC02. I am sure that someone has written this before???

ListIndex/Sorted
i think this goes here...it's about the interface.

is there a way to preserve the listindex of a listbox after it has been sorted?
for example:
(unsorted)
Item 1 - Listindex 1
Item 2 - Listindex 2
Item 3 - Listindex 3
Item 4 - Listindex 4

(sorted)
Item 3 - Listindex 3
Item 1 - Listindex 1
Item 2 - Listindex 2
Item 4 - Listindex 4

The reason i want to do this is beause i use the listindex as a way to reference a record in my array. It works perfectly as long as i dont sort the listbox, but as soon as i do, the Name in the list box doesnt correspond to the other information in the array(i'm using the name to display the information in text boxes). when i sort the listbox, the listindexes change and the information doesnt match up anymore. Is there a way i can fix this? i suppose i could use another variable to store that data and call the information that way, but that's more work, and if there's a way to just keep the current indexes, but sort the list box, that'd be much faster.

Trying To Get This Encryption Sorted&gt;&gt;
hi

this my saving/opening code:

Private Sub mnuOpen_Click()

CommonDialog1.ShowOpen
CryptFile (CommonDialog1.FileName)
OpenFile (CommonDialog1.FileName)
'CommonDialog1.FileName

End Sub

Private Sub mnuSave_Click()

CommonDialog1.ShowSave
SaveFile (CommonDialog1.FileName)
CryptFile (CommonDialog1.FileName)
'CommonDialog1.filename

End Sub

and this is my cryptfile code::::

Private Sub CryptFile(ByVal FileName As String)

'Dim i As Long
Dim b As Byte
Dim ff As Long

ff = FreeFile

Open FileName For Binary As #ff

'i = 1

Do While Not EOF(ff)
Get #ff, , b
Put #ff, , b Xor &HFF
' i = i + 1
Loop

Close #ff

End Sub

MY problem is that when i save and then open a file the textboxes will display the info as encrypted rather than unencrypted...


why is this?

thx

Sorted TreeView
Hello All,


IF I want Sorted treeview then how can I do that ? Because when I code
VB Code:
MyNode.Sorted = True
then it gives sorted view of folders but I want sorted view of folders as well as thier childs also.

When I code
VB Code:
MyNode.Child.Sorted = True
it gives error like "Object variable or with block variable not set" occures. Mynode is object created in class as
VB Code:
Dim MyNode As Node
of treeview.

I have attached my treeview display, plz tell me what code should be write to sort childs of folers.

waiting for +ve reply,

[SORTED]Shell Exe Help..
Out of pure boredom I just tried this:


VB Code:
Private Sub Command1_Click()Dim PFEnvironVar As StringDim FilePath As StringPFEnvironVar = Environ$("PROGRAMFILES")FilePath = PFEnvironVar & "MSN Messengermailtmpl.txt"MsgBox FilePathShell FilePath, vbNormalFocusEnd Sub


FilePath produces the right directory and everything, but the shell doesn't seem to work... Would like to know what i'm doing wrong

Thanks

Edit: I'm getting "File not found" but I know it exists...

HELP! Why Doesn't This... SORTED NOW
Got a little app that I wrote years ago for Win98 or something, and I was given the code below to get it to add itself to the right-click context menu of folders. Now this code still works - as long as I'm running it from within VB6. But once the exe is compiled, it no longer works - keep getting the "Error in creating registry key!" message. Can anyone work out why?

Code:
Private Const HKEY_CLASSES_ROOT = &H80000000
Private Const REG_SZ = 1&
Private Const ERROR_SUCCESS = 0&
Private Const KEY_SET_VALUE = &H2
Private Const REG_CREATED_NEW_KEY = &H1

Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long

Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" ( _
ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, _
lpData As Any, ByVal cbData As Long) As Long

Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" ( _
ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, _
ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As Long, phkResult As Long, _
lpdwDisposition As Long) As Long

Public Sub CheckIfAdded()
Dim hCurKey As Long, lngResult As Long, lngDisposition As Long
Dim MenuCaption As String, TheAppPath As String
MenuCaption = "Make Folders"
TheAppPath = Trim(App.Path & "" & App.EXEName)
'**********************************************
lngResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, "FolderShell" & MenuCaption & "Command", _
0&, vbNullString, 0&, KEY_SET_VALUE, vbNull, hCurKey, lngDisposition)
'
If lngResult = ERROR_SUCCESS Then
If lngDisposition = REG_CREATED_NEW_KEY Then
RegSetValueEx hCurKey, "", 0&, REG_SZ, ByVal TheAppPath, Len(TheAppPath)
End If
Else 'Houston we have a problem....
MsgBox "Error in creating registry key!", vbCritical
Exit Sub
End If
RegCloseKey hCurKey
End Sub

Arrays *SORTED*
VB Code:
Private Sub sckAccept_DataArrival(Index As Integer, ByVal bytesTotal As Long)    Dim sData As String        sckAccept(Index).GetData sDataEnd Sub


How can i make that send to all the current connected clients?

Sorted Array
I want to take values from an array (rValueArray) and load them into another array (BestRadialArray), after finding the values deviation from nominal (both arrays are dim Double.) I then want to sort the deviations in order of their magnatude (ShellSortNumbers). I then want to use the first three (3) values from the sorted array, I do this later in the project.
My dilemna: The sorted array is not sorted 'less to greater' so these 3 values are not the least.
If someone would tell me where I go wrong below I would appreciate it.



VB Code:
'Initializing array.     Erase BestRadialArray     ReDim BestRadialArray(12)     For i = 1 To 12              'Finding the Deviation from Gage Nominal.         BestRadialArray(i) = rValueArray(i) - (Nominal)     Next i'------------------------------'2) Sort them. See code called a shell sort'----------------------------- Dim vTemp1 As VariantvTemp1 = BestRadialArrayCall ShellSortNumbers(vTemp1)   'see sub code below'the returned vTemp1 array is now in sorted orderFor i = 1 To 12Print #1, "Deviation #" & i & "= " & vTemp1(i) _+ (Nominal / 2)Next i End Sub Sub ShellSortNumbers(vArray As Variant)     Dim lLoop1 As Double     Dim lHold As Double     Dim lHValue As Double     Dim lTemp As Double     lHValue = LBound(vArray)     Do       lHValue = 3 * lHValue + 1     Loop Until lHValue > UBound(vArray)     Do       lHValue = lHValue / 3       For lLoop1 = lHValue + LBound(vArray) To UBound(vArray)         lTemp = vArray(lLoop1)         lHold = lLoop1         Do While vArray(lHold - lHValue) > lTemp           vArray(lHold) = vArray(lHold - lHValue)           lHold = lHold - lHValue           If lHold < lHValue Then Exit Do         Loop         vArray(lHold) = lTemp       Next lLoop1     Loop Until lHValue = LBound(vArray)   End Sub

***SORTED***colours
i have the following in an activex control


VB Code:
option explicit Dim m_Colour As OLE_COLOR Public Property Get DigitColour() As OLE_COLOR    DigitColour = DigitalColourEnd Property Public Property Let DigitColour(ByVal New_DigitColour As OLE_COLOR)    DigitalColour = New_DigitColour    m_Colour = New_DigitColour    PropertyChanged "DigitColour"End Property Private Sub UserControl_ReadDigitColourProperties(PropBag As PropertyBag)     m_Colour = PropBag.ReadProperty("DigitColour", vbBlue)    DigitalColour = m_Colour    End Sub Private Sub UserControl_WriteDigitColourProperties(PropBag As PropertyBag)     Call PropBag.WriteProperty("DigitColour", m_Colour, vbBlue)    End Sub


i need DigitalColour to be = to the colour i choose in my test application in the digitcolour properties.

i have managed to get the digitcolour property to show and the colour palette to show

what am i missing

digitalcolour is a public varable in my activex control.

spider

***SORTED***timer
greetings

i have the following


VB Code:
Private Sub Timer1_Timer() Label13.Caption = Time    ' Update time display. End Sub


this gets me the system time into label13

how do i access Timer1_Timer() that is within a activex control?

spider

***SORTED***Procedures I Think
greetings

i have the following code in a number procedures

Shape1(1).BackColor = DigitalColour
Shape1(2).BackColor = DigitalColour
Shape1(3).BackColor = DigitalColour

what i need to know is what do i declare DigitalColour as i.e

dim DigitalColour as -------

and how do i set a colour to digitalColour i.e

DigitalColour = vbred

the assignment comes back as a invalid outside produre error.

spider

***SORTED*** Timer
hi

i have a label box which i want to increment according to the value of a scroll bar. i have the following which works but the label box increases to fast i need to see the value increase as you would in a timer

Private Sub Timer1_Timer()

Timer1.Interval = 1000

While Label11.Caption <= 999
Label11.Caption = Label11.Caption + HScroll1.Value
Label11.Refresh
Timer2.Interval = 10000
Wend

End Sub

spider

Sorted: Use % Instead Of * --SELECT Using LIKE
Code:
CustRS.Open "SELECT RecNo, Name FROM Customer WHERE Name Like '" & Replace(txtFind.Text, "'", "''") & "*'", Cn, adOpenStatic, adLockOptimistic
Using the above code I get no records returned even though there are records existing for the criteria I am using. No error is generated just no records returned????

Sorted With Numbers &gt; 9
Hi all,

I have a list box that is populated with numbers from 1 to 50, however when I turn Sorted on, it appears as the following:


Code:
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
25
etc.


instead of


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
etc.


Any ideas how to achieve this?

Thank you

Sorted Combo Box?
hi all
It is simple one..but does it has any other simple way?
i am using combo box which has style=0 and sorted=true
i want that whenever i pressing an alphabet if the item starting with that alphabet is present then it will show me that item in combobox and if not present then it will allow me to enter it in combobox
e.g i press "M" then "Mango" should be display.
I had written code using mid function,it is working but it is too much long, does anybody have simple solution
thanx in advance
Gary

Substrings ..... Sorted Thanks.
I have a String e.g. "123-abcd-efgh ". I need to divide this string into substrings e.g

dim sString, first, second, third as String
sString = "123-abcd-efgh"

**
Result:
first = "123"
second = "abcd"
third = "efgh"


The position of the dash is not set.

[Sorted] Max Size For An EXE
Any one know if there is a limit to how big an EXE can be before VB throws up errors?

Data Not Sorted
Hello,

In access I have sorted the "name" field in a decending order. So when data is added fom VB it is in an order I want.

However, when data is viewed using the dbgrid object the order is not what i want. it appears to be sorting by the "address" field.

Is there a way in vb that i can sort from the "name" field.

I am not quite sure what code format i am using so here it is:

Set db = OpenDatabase(App.Path & "db1.mdb")

Set rs3 = db.OpenRecordset("hoy", dbOpenDynaset)

cheers,
mickey

List Sorted Help
Hi,

Thanks very much for the overwhelming support that I got from thislearning group and highly interactive group.

I am designing an application wherein I would prefer to have a listbeing displayed with the list of all the records in a particular tableof a database in Access. i normally show the same in the same order asthe one present in the database, however the client wants it sometimesin the sorted order for the sake of searching and then may be back tothe unsorted order.

The sorted property of the list is read only and does not allow to bechanged at runtime. is there any other way other than using an ORDER BYSQL statement in the query itself and then omitting it for an unsortedorder. Doing this will waste vital time in accessing the database, asrecords often reach figures of 1,000.

Thanking in anticpiation,

Vincent
Goa

Sorted Listbox
This is probably pretty easy, but I am struggling with it. I have a sorted listbox with checkboxes. My program is a addin to another program, and when it closes it stores the names of all the items in the listbox along with their checked value in a attribute of the supporting program.

I have to go by names, because between the time I close and open the user could have changed the number of items that get populated into the listbox. My problem comes in startup. I know I could populate the listbox, and then iterate it looking for matching strings, but because of the mechanism to get the string value from the attributes and the large size of the string it is already taking 35 seconds for my program to start. I really don't want to slow it down any more if possible. Is there a something similar to a node as used in treeviews where I can set the item in the listbox to a reference and then set the selected value to that node all in one loop.

Hope that is clear... basically what I am hoping for is a method to process the selected value within the same loop I am using to add items to the list.

Thanks in advance for any help

Help...sorted Question
hi,

I am trying to arrange the items in my listbox in alphabetical order. But i don't know how to use sorted... can anyone help me?

thanks...



Edited by - gen23 on 5/6/2004 11:12:22 PM

How Sorted Is Array
I am inputing some data into a udt which is then sorted using quicksort algo. Over time more data is added to the now sorted udt and it needs sorting again. The positions might have changed completely and using quicksort again would yield the quickest result. But if positions have not changed very much insertion sort would do a much faster job.

I was thinking of comparing 5%-10% of random adjacent array members to decide if the array is sorted or not, i.e. Insertion vs Quick sort.

Is there another way to acomplish this?

there are around 500-1000 members in UDT.

Treeview Not Sorted
I have a treeview with the following items/nodes:
M-1-1
M-1-2
M-1-3
M-1-10
M-1-11

and the treeview not sorted.
It displays the following image

M-1-1
M-1-10
M-1-11
M-1-2
M-1-3

I have set the property sorted to true but treeview not sorted.
What i am wrong?

Thanks in advance

Sorted Tables
Hello,

I am currently writing a program that is to be used as an address-database, including names, addresses, etc.

So far, I have always used a querydef to make a 'sorted' copy of my original table, since I thought that my main tabledef is not necessarily sorted.
Today I saw, that this is not the case but the addnew-command seems to add the record in the correct position.

My question is:
Is it only on my system that I can rely on sorted tables in a JET-Database of the .mdb type, or is it always the case - I can guarantee that all the databases are created using my own programs...

Sorted Property
Why can I not set the sorted property at runtime? It works fine at design-time.

Making A Sorted Tree
Hi all,

I would like to dynamically create a sorted tree, like a binary node tree or even a BTree, but I've never done this in VB, only in C++. How do you make nodes and then dynamically create them in VB? The nodes I would like to make would be a 2 field node with a name in one field and then a list of names in the other field. For instance, in C++ the code would be like this:

struct Node{
string Name; //stores name of Node in tree
string Names[10]; //holds node's data
string *lptr; //points to next node by name (left child)
string *rptr; //points to next node by name (right child)
};

is something like this possible? Is there an easier way in VB?
Thanks in advance!

Combo Box And Sorted Property
I have a mulitdimensional array and I use a column from this array to populate a combo box. There maybe duplicate data so I first store the column in a collection so I will only get the unique names and then I add them to a combo box. I have the combo box property Sorted set to true. Is there any reason why the items in the combo box would not be in alphabetical order? Here is some code:


Code:
'This code will only take the unique names if they are to be shown.
On Error Resume Next
For i = 0 To UBound(tempSortArray, 2)
If tempSortArray(0, i) <> "" And tempSortArray(0, i) <> "0" And IsNumeric(tempSortArray(0, i)) Then
col.Add tempSortArray(0, i), tempSortArray(0, i)
End If
Next

cmbColumn(0).AddItem " Select All ", 0 'We are placing this in the first position
cmbColumn(0).AddItem "", 1 'We are placing this in the second position

For i = 1 To col.count
cmbColumn(0).AddItem col.Item(i), i + 1
Next

Query With Count And Sorted
Good day,

I know it is possible but I just can't find how to perform it.

Let's say I have this table with two fields (Customer and City) with about 200 entries in it.

I would like to build a query that will generate these results :

New York : 46 results
Montreal : 20 results
Texas : 16 results

...and so on.

In other words, a query that will sort descending the city entered in the table occurences. i think it has something to do with the Count keyword

Any hints ?
Many thanks

Help With Excel Objects - SORTED
My VB6 application references the MS Office and Excel Object Libraries to create reports. To save time, I have three excel sheets that I use as templates, and this system has worked perfectly...

However, I've recently upgraded my development PC from Office '97 to 2003, and whereas I was using the Office and Excel 8 OLs, I'm now referencing the 11 OLs.

Of course, everything still works fine on this PC, but when I run the updated version of the app on machines with previous versions of office installed, the whole app crashes at the point where it tries to open one of the template xls files - not, to my surprise, where it creates the excel object.

Seems to me that there's a backward-compatibility thing going on here. Question is, do I need to compile my code on a PC that has Office 97 on it, or is there some other way round this? Does including the Excel.exe and MSO.dll files in the installer package help in any way? (well, it doesn't, but should it?)

I'll admit that my understanding of these things isn't all that...

Cheers,
Nick

Sorted Directory Listing
When I use the DIR function to enumerate through a directory, it shows the list in any order. I want it to be sorted on say name or date created etc. (Just like the DOS Dir /AD /ON command works)

2. It is showing the files also. It should show only Directories only, not files.

This is how I am doing it right now.

VB Code:
Private Sub Command1_Click()    Cls    DirList "C:Documents and SettingsAdministratorDesktop"End Sub Private Sub DirList(ByVal sFolder As String)    Dim sDir As String    sDir = Dir(sFolder & "", vbDirectory)    Do While sDir <> ""        Print sDir        sDir = Dir    LoopEnd Sub

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