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




How Do I Can Select A Row In A DBGrid1 And Display Its Contents?


How can I select a row in a DBGrid1 and display its content in another Form? The DBGrid1 is bound to a data control which this is bound to a table in a database.

I need to select just one row of my recordset visible in a DBGrid1, then after select this row I need to open a form and display all the fields of my selected row on another form.

thank you in advence




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I Link Data From Data1 Into 4 DBGrid From 4 Table Select In DBGrid1 ?????
Yes its me agen
Hi folks

Now I wonder How?

I use data1
to read from and save to tatabase to 2 Table and read back to grid

I use

Table customer - with field , NR, Name, Address, Phone,

Its ok to save and read from database

Now I want to Link the NR from name in customer to NR in Table Servise

So when I read customer from data1 into DBGrid1 then I want to see the servise I dit put on the customer in Table Servise into DBGrid2

I use 4 DBGrid in this program ,
DBGrid1 the customer
DBGrid2 Servise
DBGrid3 working time of the customer
DBGrid4 the rent of tools to the customer

I need to lenk all this data so when i select the customer in DBGrid1 i get the rest of the data into DBGrid 2 - 3 - and 4

I use this to call database

Data1.DatabaseName = App.Path & "Databaseilanir97.mdb"
Data1.RecordSource = "TransMaster"
Data1.RecordSource = "Select * From TransMaster Where staða = 'Opið' "

To Display The Contents
hi,
The following codes are for appending some text to a text file
It works fine but the problem is when I want to click command2 button to display what I have already written,it doubles the contents which are already there..
How can I fix the problem..?
thanks

VB Code:
Private Sub Command1_Click()Dim gir As StringOpen "C:one.txt" For Append As #1gir = InputBox("my text")Print #1, girClose #1End Sub Private Sub Command2_Click()Dim met As StringOpen "c:one.txt" For Input As #1Do While EOF(1) = FalseInput #1, metLabel1.Caption = metText1.Text = Text1.Text & metLoopClose #1End Sub

Display Contents
someone plz tell me how to Display the contents of a folder in the DirListBox that user clicks on...in my listview next to it

more explanation: Ihave a DirListBox and a ListView....iwant what folder clicked in dirlistbox to be displayed in the listview... lol

iam lil confused wit how ?

How To Select Contents On A Page?
Hi,

I need to copy a specific page of a word document (say enter page 2) and copy all of the contents of that page into a new document (say "New Document").

The problem is how to select the text on that page alone (ie I can't use wdParagraph etc) and how to specify to copy it to a new word doc (since the new document name could change depending on how many new docs you created in that session).

Can anyone help? I'm mostly concerned about copying the page contents. Any help will be appreciated.

Thanks,

Michael

How Do I Select The Entire Contents Of A RTB?
The subject says it all really.......

How can I select the entiure contents of a rich text box on Click of a button?

Oh one other question - Why doesn't my right mouse button work over the RTB?? I can copy and paste using Ctrl+C and Ctrl+V but no right mouse menu???

Thanks

Chief

"Dammit Smithers, this is brain surgery not rocket science!! Now hand me that ice cream scoop..."

How Do I Can Select A Row And Open Its Contents?
How can I select a row in a DBGrid1 and after select it clcik the row and display on another form2 their contents in text boxes. I did like that but it is not working!

DBGrid1 in the Event Click I put this code

DBGrid1.RecordSlector = True
DBGrid1.SelBookMark(0) = DBGrid1.BookMark(0)
Data1.Recordset = DBGrid1.BookMark.Row(0)

Anybody can help me please because I have not Idea how to start.

Thanks all of you

Display Contents Of A .nfo In A Text Box?
Hello all. Being very new to VB, I was wondering how I would load the textual contents of a .nfo (or a .txt for that purpose, .nfo is just popular 'cuz the icon looks cool) into a text box on a form? I want it to be unmodifiable. In fact, it is basically going to be one of those legal disclaimer/license agreement things that you see when you install anything: a plain text box that says you can't sue them if this program causes you to have seizures.

I would appreciate any help.

Display Contents Of An HTM File
How can we modify the following code so as to display the content of a html file using Rich Text file?



Code:
Private Sub Command1_Click()
Dim strListItem As String

Open "c: ah12.htm" For Input As #1
While Not EOF(1)
Line Input #1, strListItems
list1.additem
Wend
Close #1
End Sub
Edit by loquin: gencoglu27: I split this post off the earlier thread, as it had nothing to do with the prior topic. Separate follow up topics should be posted in their own thread.

Display Contents Of An Xml File
anyone know how I can display an xml doc after updating. within a vb app

cheers
R

How Can I Select Only Part Of A Cells Contents
How can I in Excel select only part of a cells contents (Or better, delete the parts I don't want) based on certain criteria. I.e. If I have many numbers in a cell each preceeded with ~ apart from lets say 2 numbers e.g. ~1 ~2 ~3 4 5 ~6 ~7 how can I automatically delete all the numbers preceeded with ~ to be left with in this example 4 5?

Select Range Of Cells Same Contents
How can I select a range of adjacent cells having the same content?

The purpose is to select a group of cells to export to a new file: a new file for each group of same rows having the same content in the first cell of the column.

Thanks

Select Entire Contents Of Textbox
Simple question.
How can I get VB to select the entire contents of a textbox when the focus moves to the textbox?

While I am at it, How can I change the enter key so that when it is pressed, the focus moves to the next control (instead of the tab key).

Thanks,
Chris

Display File Contents On A VB6 Form
Hi,
How can I make a form with a powerpoint show embeded in it, like a picture.
I do not want it to open powerpoint or run the slide show in full screen. Is this possible.


Regards, Matt

Display Form Contents On Desktop?
Hi all, i was wondering if it is possible for me to display a textbox on the top right of the desktop so i can put reminders in there, because i am a programmer in other languages such as c++ i would find it usefull just to put notes onto a textbox in my desktop instead of opening up notepad all the time with my over crowded taskbar.

Thanks in advance.

Display Contents Of Listview In Different Colors.
How can we display the contents of listview in different color depending on some condition. I have set Listview1.View = lvwReport

i want something like :

dim litem as listitem

While Not rsFieldName.EOF
'Check for some condition
If rsFieldName.Fields("field") = 2 Then
??????
'SET FONT COLOR = RED
Else
??????
'SET FONT COLOR = BLACK
End If
Set litem = Listview1.ListItems.Add(, , rsFieldName.Fields("Caption"))
rsFieldName.MoveNext
Wend

Thanks in advance.

Take Contents Of A File And Display On A Richtextbox
how come when i get the contents from a .doc file to be displayed in a richtextbox i get a garbage.. please help.. tnx!

Display Contents Of A Speadsheet In Cells
Hi,

I have created a userform that when you click the drop down menu(combo box) and select a number it will autofill the rest of the data in the text boxes in the same userform. The code used is shown here


Code:
Private Sub cbJobNo_Change()
Dim rFoundSource As Range

Dim strText As String
Dim tBox As Control
If cbJobNo.ListIndex > -1 Then
strText = cbJobNo.Text

Set rFoundSource = Range(cbJobNo.RowSource).Find(what:=strText, _
after:=Range(cbJobNo.RowSource).Cells(1, 1), _
LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByRows, _
searchdirection:=xlNext, MatchCase:=True)

For Each tBox In Me.Controls
If IsNumeric(tBox.Tag) Then
tBox.Text = rFoundSource.Offset(0, tBox.Tag)
End If
Next tBox
End If


Sheets("applications issued").Select
Sheets("Applications Issued").Range("a4") = _
PaymentApplication.cbJobNo.Value
End SubPrivate Sub cbJobNo_Change()
Dim rFoundSource As Range

Dim strText As String
Dim tBox As Control
If cbJobNo.ListIndex > -1 Then
strText = cbJobNo.Text

Set rFoundSource = Range(cbJobNo.RowSource).Find(what:=strText, _
after:=Range(cbJobNo.RowSource).Cells(1, 1), _
LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByRows, _
searchdirection:=xlNext, MatchCase:=True)

For Each tBox In Me.Controls
If IsNumeric(tBox.Tag) Then
tBox.Text = rFoundSource.Offset(0, tBox.Tag)
End If
Next tBox
End If


Sheets("applications issued").Select
Sheets("Applications Issued").Range("a4") = _
PaymentApplication.cbJobNo.Value
End Sub


This works well but i want to have another drop down list on the same user form that reads data from a different work sheet. I thought this would be easy but as you can see from the code, there is no where in it that says what sheet it is working with. Any ideas how i can get this working? I have tried using sheets("worksheet1").select but this does not work. The only code that i have changed is the name of combo box.

User form is attached

Display Contents Of Form Keep Getting Erased
Hi! I'm having a problem with the contents of my forms data getting erased.

My application is grabbing data from a USB 2.0 digital camera. I call a camera function called VbStartVideo which has a parameter that points to the frame buffer that receives the data.

In my case I'm grabbing data from the camera directly to a form. VbStartVideo frmd.hwnd

Everything works fine when the camera is constantly outputting data. The problem happens when I stop the camera. I can see the last image however when I pass anything on top of the form or minimize the form or pass another application over it (such as notepad) I lose all the data inside the form. Basically I just see the forms background. See attached image.

My goal is to be able to place things on top of the form that is not grabbing and not overwrite the last image.

Thanks!

Display Contents Page Of Help.hlp File ?
hello

i've a help.hlp file.
in the project properties i've set the help file and set Project Help Context ID=12

in click of Help Contents from menu 've written -
dlgHelp=cdlHelpKey
dlgHelp.ShowHelp

dlgHelp is the name of the Dialog Box.

but when i click on Help Contents, it opens the index page of the help box.

moreover, when i made the setup of the project and run the .exe on some other system, it simply shows the index, with the Contents tab missing from the help box.


pls help ....
i need to display the Contents page when i click on Help Contents
& the Index page when i click on Help Index.

thanks in advance
shruti !

Display Directory Contents In A Listview
Im having problem using Listview control...in my application, i want to display all files in a particular directory...let say i only want to display a directory Dir1.Path = "C:ISISArchive"...and then i want my listview to view all files in this directory...

can someone show me a code for this???
ur help would be much appreciated!!!

How Do I Get The Contents Of A Text File To Display As Is
I need to show the user the contents of a text file. Originally I tried reading it in and then writing the data to a text box but the original spacing between columns was changed. Now I am creating an OLE object which displays the file in the form of a notepad to the user who can then double click it to see the contents in notepad.exe.

I want to bypass all that and just have the contents of the file displayed with original formatting, without the user seeing a notepad to double click.

How do I do this?

Display Contents Of Folder In A Listbox
Hi,

I seemed to have forgotten how to do this, but...How do I display the contents of a folder in a listbox? I know I can use the FileSystemObject, but surely there's some kind of API I can use as well?

DBGrid1 Question
In a data grid if I want to sum or add to two columns in which event can I put this operation

dim Sales as String
dim RorSales as string

Sales = DBGrid1.Columns(3).value + DBgrid1.Columns(4).Value
TotSales = DBGrid1.columns(5).value + Sales

How To Select Entire Contents Of Txtbox When Clicking On It
I need something that when the user clicks in the textbox, it selects the entire contents. However, using the help from this thread I don't get that result.



Code:
Private Sub TextBox1_Enter()
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)
End Sub

Private Sub UserForm_Initialize()
CommandButton1.SetFocus
End Sub

Please see attachment for an example of my problem.
Thanks in advance,
Aaron

Edit: Digging up and hijacking other member's old threads is a big no-no. Make your own threads and provide a reference.

How To Select Entire Contents Of Txtbox When Clicking On It
How do you auto-select the contents of a textbox when you click on it?

Display Recycle Bin True Contents In Listview
Over the past couple of days I have been working on a mini-file explorer. I have it listing the drives,directorys in a treeview and showing the lists in a list view.

But I have not figured out how to display the true contents of the recycle bin. I can display the individual recycle folders on the various drives but I am looking to display them as one in the listview as it does in windows explorer. Does any one know how to do this or has some sample code to show how to display the RB??

TIA Very Much..

P.S. I have looked on all the usual sites but have found no code to do this.

Display Array Contents In Text Window
I need help displaying the results from one of my scripts. Currently, I write my output to a growing array and then use the msgbox function to display the whole thing at the end.

I have 2 problems with this.

#1 - I sometimes run out of room in the msgbox when my output gets too big

#2 - The user has to dismiss the msgbox before he can go back into the spreadsheet.

I'd like to be able to display the data in some kind of text box window that the user doesn't have to dismiss right away to start using the spreadsheet again.

I've thought of writing the results to a text file and then launching notepad or something to view the data, but there has to be an easier way to do it in visual basic in excel.

Any help?

Thanks

-Jeff

Display Contents Of A Counter In A Textbox/label ??
Hi guys,

This is probably quite a basic question. I am using Visual Basic 6.

I have a counter.. CounterA.

How do I display the content of this counter in a textbox or label or something of that sort?

I tried this: lblA.AddItem (CounterA)

But it returned this error: Run-time Error "438":
Object doesn't support this property or method.

Please help

ListBox Display Directory Contents Matching *.mp3*
I have a DirListBox and a ListBox. I want so that whenever the button "updateList" is pressed, the ListBox displays the files in the directory the DirListBox has selected that match the extension .mp3 . For use in a media player type program thanks

Code To Display Contents Of A Table From A Database
Hie...

I am looking for a code to perform the following:

1. Created a database with the table IT_COMPANIES having the fields compid, compname, dtestablished etc. The table has 100 records.

2. Created a form IT HISTORY with a button btnmoredetails, on clicking the button, the table IT_COMPANIES should be opened, but displaying the first 10 records. Now in this case the table should have the next and previous buttons to navigate to the next or last 10 records.

Please help me with a code that will perform the tasks in step two.

How To Automatically Display Contents Of Excel File
hi experts,

i created a module that dumps everything in an excel file. how can i automatically display the contents of that file?

would appreciate any thoughts/ideas on this.

thanks and regards.

ann

Display Contents/open Combo Box ~ Resolved
A long long time ago in a galaxy far away a programmer used send keys in Access. Now that lazy programmer (not me I promise) has gotten into trouble since Vista has come along. Long story. To surmise, I need to get rid of send keys in the Access app.

Now to the one that I haven't been able to find different code for. When we open a form, at times we place focus on a certain combo box and send Ctrl + F4 to it to open the combo box and display the contents. I don't want to replace these with list boxes for various reasons. Is there a property setting or command I can use to display the contents without using send keys?

~Elizabeth~

"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila "


Edited by - Aurian on 8/29/2007 6:08:08 AM

DBgrid1 Column Width
I'm trying to set the widths for the columns in a dbgrid1 unsuccessfully! How is this done?

Thanks

JO

VB Can't Display DataGrid Contents In Office 2000 Environment
Hi all,
I wrote a program using VB. The program uses ADODC and DataGrid with Access for the database. It also creates Excel files from the DataGrid contents.

When I ran it on Office XP and Office 2003 environment, it works well, no problem. But when I try it on Office 2000 environment, the DataGrid WON'T show anything, although the database is filled and the Excel files are created (no problem with the function to store to the DB and create Excel files).

FYI : Everytime I run the EXE file in Office 2000 env, it always asks for Office 2000 CD. But after I put the CD and copy files from it, no change, nothing happens....

Can anyone tell me how to solve it? Maybe there's a special DLL or OCX I have to include so the DataGrid can show the contents?

Thanks a lot

VB Can't Display DataGrid Contents In Office 2000 Environment
Hi all,
I wrote a program using VB. The program uses ADODC and DataGrid with Access for the database. It also creates Excel files from the DataGrid contents.

When I ran it on Office XP and Office 2003 environment, it works well, no problem. But when I try it on Office 2000 environment, the DataGrid WON'T show anything, although the database is filled and the Excel files are created (no problem with the function to store to the DB and create Excel files).

FYI : Everytime I run the EXE file in Office 2000 env, it always asks for Office 2000 CD. But after I put the CD and copy files from it, no change, nothing happens....

Can anyone tell me how to solve it? Maybe there's a special DLL or OCX I have to include so the DataGrid can show the contents?

Thanks a lot

File List Box...Is There Way To Display The Contents Of Two Folders In A Filelistbox?
Is there a way to display the contents of two folders in filelistbox, instead of only displaying the contents of one folder. I would use two directory listboxes and then the if the paths of the both of those could display in the same filelistbox that would be what I want.
Thanks!
Eric

Need Program To Display .txt File Contents As A Scrolling Window
It's been 15 years since I did any Basic programming, so
I was wondering if I could get some help.

I want to display the contents of a .txt file in real-time
as the file is updated. I don't want to just copy the entire
contents, but only update the scrolling window with newly
added info which I can scroll back to see previous updates.

Anybody out there willing to take on this project?

Thanks

Big Fred

P.S. OS is Windows 2000

Creating Form In VB To Display Contents Of An SQL Database Table
Hi,
I am a biginar, I dont't know much about VB. I have a MSSQL server "Test" and upsized a access database to this SQL server. Previously i was accessing the database from the access form, now the database is on SQL server and don't know how to access it. I heard that VB can help me to create a form using which I can access SQL databases. My databse name is "temp" with a table "test"
Can some budy help me to create a VB form so that I can open the databse "temp" from server "test" and display the contents of table "test"
Thank you.
Arun.

Resize Dbgrid1 When You Press ENTER
I'm using a dbgrid1 on my project, and i have word wrape set. Is there a way to make the row grow when the words wrape to the next line? You cannot see all of the text unless you use the up and down arrow. I want it to grow to show all text.

This Code Does Not Populate My DBGrid1, What Wrong I Did?
I need help pls


Option Explicit
Dim db As Database
Dim rs As Recordset

Const MaxCol = 5
Const MaxRow = 100
Dim MyData(MaxCol, MaxRow) As Variant
Dim sBase As String

Private Sub Combo1_Click()
Call OpenGrid
End Sub

Private Sub DBGrid1_UnboundGetRelativeBookmark(StartLocation As Variant, ByVal OffSet As Long, NewLocation As Variant, ApproximatePosition As Long)
' DBGrid1 calls this routine each time it
' needs to position a row.

' StartLocation is a bookmark supplied by the grid to
' indicate which records the grid wants to positioning from.
' If StartLocation is NULL, then data is requested either
' from the first row or the last row.
Dim curRow%
If IsNull(StartLocation) Then
If OffSet < 0 Then
curRow% = OffSet + MaxRow ' Reading data from the last row
Else
curRow% = OffSet - 1 ' Reading data from the first row
End If
Else
' Positioning from StartLocation plus the OffSet
curRow% = Val(StartLocation) + OffSet
End If

If curRow% < 0 Or curRow% >= MaxRow Then
NewLocation = Null
Else
NewLocation = curRow%
ApproximatePosition = curRow% + 1 ' One based
End If
End Sub

Private Sub DBGrid1_UnboundReadData(ByVal RowBuf As RowBuffer, StartLocation As Variant, ByVal ReadPriorRows As Boolean)
' DBGrid1 calls this routine each time it needs data.

' Keep track of how many rows have been provided by the
' programmer to the grid.
Dim rowsFetched%
rowsFetched% = 0

' See if the grid is requesting data forward or backward:
' If ReadPriorRows = True, then the grid is requesting
' rows prior to the StartLocation (backward).
' If ReadPriorRows = False, then the grid is requesting
' rows after the StartLocation (forward).
Dim incr%
If ReadPriorRows Then
incr% = -1 ' Reading data backward
Else
incr% = 1 ' Reading data forward
End If

' StartLocation is a bookmark supplied by the grid to
' indicate which records the grid wants to read.
' If StartLocation is NULL, then data is requested either
' from the first row or the last row.
Dim curRow%
If IsNull(StartLocation) Then
If ReadPriorRows Then
curRow% = MaxRow - 1 ' Reading data from the last row
Else
curRow% = 0 ' Reading data from the first row
End If
Else
' Reading data starting from the row next (previous) to
' StartLocation
curRow% = Val(StartLocation) + incr%
End If

Dim i%
i% = 0

While i% < RowBuf.RowCount
If curRow% < 0 Or curRow% >= MaxRow Then
' No more data to read, return RowCount and exit. Note
' that the grid does not need to know the total number of
' rows ahead of time. This is an important concept because
' this enables the unbound grid to operate under a virtual
' mode (i.e., it can be used to display unlimited rows of
' data) for any data you wish to display.
RowBuf.RowCount = rowsFetched%
Exit Sub
End If

' Return the row data to the grid through the Row Buffer
' (RowBuf) object.
RowBuf.Value(i%, 0) = MyData(0, curRow%)
RowBuf.Value(i%, 1) = MyData(1, curRow%)

' Use the array row index as a bookmark and return it to
' the grid.
RowBuf.Bookmark(i%) = curRow%

curRow% = curRow% + incr%
rowsFetched% = rowsFetched% + 1
i% = i% + 1
Wend

' Return the number of rows of data fetched
RowBuf.RowCount = rowsFetched%
End Sub

Private Sub Form_Load()

sBase = "C:CountryCountry.mdb"

Set db = OpenDatabase(sBase)
Set rs = db.OpenRecordset("Country")

With rs
Do Until .EOF
Combo1.AddItem !Contries
.MoveNext
Loop
End With

End Sub
Sub OpenGrid()
Dim rst As Recordset


Set rst = db.OpenRecordset("Cities", dbOpenDynaset)

' Set approximate count value:
DBGrid1.ApproxCount = MaxRow


With rst


' Initialize MyData
Dim i%, j%

For j% = 0 To MaxRow - 1

If .EOF Then
Exit Sub
End If

For i% = 0 To MaxCol - 1
MyData(i%, j%) = rst(i%)
Next i%

.MoveNext
Next j%


End With


End Sub

Manny Tanks in advance

DBGrid1.DataSource Property Question
Hello,

I would like to know if it is possible to set the DBGrid datasource
property to a Data control at runtime?

I tried several ways but i get Runtime error '430':
Class does not support automation or does not support expected interface.

Any help would be much appreciated

Thanks

Karl

Best Control To Use To Display Contents Of An ASCII Text Appending File?
Hi,

I have a chemical analyser grinding out results for several process streams. As part of saving historical data, I format the results from each analysis into an ASCII string with timestamp, and then append the string to the appropriate sample file.

What is the easiest way to allow the user to scroll through such files?

For event logging, I have set up a series of text lables (15 say) and the used a vertical scroll bar to dispaly 15 of the last 200 events. The events are stored in a circular buffer, which contains the last 200 events. This works well, as I can color each line to indicate the type of event (yellow on red for error, white on green for result, white on blue for standard..). But the coding is fairly complex and am looking for a simple display of analytical results for a given sample stream.

In the case of the anlysis results, the data is appended, so the file just keeps growing. Presumably, monthly files will be separated and stored.

Need A Control To Display Text File Contents In Editable Form
Hi all,

     I need to display the contents of a .txt file on interface in an editable formate.
                Also want to store those edited contents in a .txt file.
                Could some one suggest me a suitable control for this purpose.

                Thanks

sachin

 

Realy Need Help Please,, Treeview To 3 Listview, DBGrid1 To Slow
I use DBGrid1 to call from database

Table customer into DBGrid1
and when I klick on DBGrid1 I get info from Table workingTime into DBGrid2
From Table Rent into DBGrid3 and from table Whois into DBGrid4

In Table customer I use NR=autonumber
so when I klick on DBGrid1 I use NR to call same NR from Table workingTime, Rent and Whois

DBGrid1 is to slow, so I want to tray to use treeview and listview

But need help to now how I call customer into treeview and use NR from treeview to call the rest from NR in rest og the table
and pudit into listview..

HOW? HOW?

PLEASE som

How To Have A Textbox Accept Full Pathname Entered &amp; Display Contents In Picturebox
Just learned how to create a textfile and have VB read it and display one OR all lines into a picture box.

My inquiry is on another method:

(a) I also have a textbox. Want to set it to accept the input of full textfile pathname, then the textfile is read and contents displayed in the picture box.

How would I do this? I was thinking to use an IF statement?? Really not sure.

I've attached my program files as that is only part I have not coded. (small beginner program)

Thank you for any help.
~ Juanita

Using MsChart MouseOver Event To Display The Contents Of Array That Populated Chart
I want to be able to view the data that has populated the Graph control by using a Mouseover event as the PointSelected Event does not work if I have a lot of data points on my graph - MouseOver would be much nicer anyway. Currently I use something like this:

Private Sub ActiveChart_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)

On Error Resume Next

Dim lngZeroXAxis As Long
Dim lngEndOfXAxis As Long
Dim lngLengthOfXAxis As Long
'XCoordinate at intersection with YAxis
lngZeroXAxis = 1230
'XCoordinate at end of graph
lngEndOfXAxis = 11895
'Length of graph
lngLengthOfXAxis = lngEndOfXAxis - lngZeroXAxis

Select Case X
Case Is <= lngZeroXAxis
txtXCoordinate = 0
Case Is >= lngEndOfXAxis
txtXCoordinate = 0
Case Else
'Display contents of datapoint selected in two dimentional array
txtXCoordinate = m_PreservedXAxisData(0, CInt((X - lngZeroXAxis) / (lngLengthOfXAxis / m_lngTimescale)))
End Select
'Display X Coordinate
Text1 = X
'Display Y Coordinate
txtYCoordinate = y
End Sub

Here m_PreservedXAxisData is a two dimensional array and m_lngTimescale=1

Problems are that depending on the scale of the graph lngZeroXAxis & lngEndOfXAxis change

There must be a better approach than this! Can someone please help?

SQL Select How Do I Display 17.00 Just As 17
I am selecting a decimal field from my sql database. When I select the field it is displayed as 17.00 but I want it to show just as 17. Can anyone please help me with the function that I can use to achieve this?
Thanks

"The answer is out there, Neo, it’s looking for you. And it will find you, if you want it to."--Trinity to Neo

Display And Select Shapes
Hi,


I would like to display many shapes .

The commondialog control displays the color dialog box

is there a way to display all shapes and select those shapes
as we select colors?


thank u

Select And Display From 2 Tables
I have two tables (sales and purchases) in my Access DB that have 4 fields (ID, Date, Amount and Description). Currently I display the contents of each table in a seperate MSFlexGrid, however I want to display the contents of both tables in the one MSFlexGrid sorted by date. Can someone give me some help with some sample code.

Thanks.

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