|
-
Nov 15th, 1999, 04:47 PM
#1
Thread Starter
Hyperactive Member
hi! I wanted to know if there's any VB control which you can use as a table. I want to sort the value of different variables from biggerst to smallest. Does anyone know an easy way to do this? Thanks in advance,
Alexander McAndrew
-
Nov 15th, 1999, 07:15 PM
#2
If you're talking about to show the data from the table in your VB application then you can use an SQL statement to specify the order.
Select * From MyTable Order By Column1 Desc
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-16-1999).]
-
Nov 15th, 1999, 09:50 PM
#3
Thread Starter
Hyperactive Member
thanks, but how can I create a table and add things to it during run-time? Should I use an excel chart? Or is their a VB control I can use? Thanks in advance,
Alexander McAndrew
-
Nov 15th, 1999, 10:42 PM
#4
You can use any controls that suites your needs. For example, lets say you have a table called Customer. So the table Customer structure will look something like this:
Fields
CustID - Autonumber
CustFName - Text
CustLName - Text
Address - Text
City - Text
State - State
Zip - Text
Phone - Text
So, the best way is to create a control array of TextBoxes. So, lets say we have a contols array named txtInfo (7 textboxes)
And now we want to save the info you typed in the textboxes (the CustID will be created automatically). Also, in this sample I assume that the database is an Access database.
Code:
Dim db As Database
Dim rs As Recordset
Dim i As Integer
Set db = Workspaces(0).OpenDatabase("D:\Microsoft Visual Studio\VB98\Nwind.mdb")
Set rs = db.OpenRecordset("Customer", dbOpenTable)
rs.AddNew
For i = 0 To txtInfo.UBound
rs(i + 1) = txtInfo(i)
Next
rs.Update
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-16-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|