Click Datagrid Row And Display Details To Another Datagrid
hello there..here i need help. i have a datagrid that retrieve data from database.what i want to do with the datagrid is when i click any rows of the datagrid it can display the details of the data (refer to the row that i click) to another datagrid.
is there possible to be done ?
i want to know if there is any procedure that can capture the datagrid row that i clicked
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
DataGrid Click-Display
HI,
Iam Using DataGrid in my application. I got the Datagrid Display.
The First column is my Primary Key, so that i can search the database based on this key.
Now upon clicking any where in the row i want to display the details in another form.
How to go about it.
Thanx,
harry
Transferring Row Details From Datagrid
Hi!
We are doing an employee holiday request system and we need some help. We have all the requested holidays appearing in a datagrid. We want to select one of the rows manually and transfer the data to another datagrid on a different form. We have accept and reject buttons to send the holiday to accepted or rejected holidays datagrid. Hopefully somebody can help.
Thanks
How To Show The Particular User Details In Datagrid
Hi all,
Can anyone tell me how to get a record for particular user or Number
In my sql i,v Pinvoice table following fields
InvNo int1001
ItemNo
001
002
003
Descrption varchar(20)Fan
Chair
Table
Price float
90
100
20
Qty
2
5
10
Gross
180
500
200
so my question is if type the InvNo in a textbox this all records i need to display in a grid if i type the another Invno then it has to show me the corresponding InvNo Records in the same grid or else In a button Previous Or Next it show me like this and in below the Grid i need the total for theGross amount , so can anyone tell me how to do this
Use Form Invoice With DataGrid As Details
Dear Moderator and All of you Valued Programmers.....
Please help me about above...............
I want to make Database Program Invoice Field Invoice : No.Invoice, Date, Customer, Address and Details for Invoice Field : Item, Qty Ship, Price, Total Price.
How do i if i wanna make Form Invoice with details ( Form With Subform),...Please help me..
Thanks
Arifin Aritonang
Indonesia
Creating Master-Details Lists With The DataGrid Control
At work we are working on a VB6 project to be a front end for our equipment database and chage the status of the item when we sell it. We have two tables, one to store the listings (complete systems) and the other table to hold the individual items of the systems ( parts, accessories) The problem we have is if we sell a system we need to have the description of the system from one table, while if we just sell one part, we just need from the other table the description of that one part. Essentially, if we sold just a part we would use one description, if we sold a system the description field would contain info from the other table. (so i can't directly link a datagrid column with a specific column from a table on the database) I was thinking that a master details list in a datagrid control would be flexible enough to do it. The problem is this, I do not know how to create this master details list. Does anyone has any information on how to do this or has any better ideas of displaying this information? My boss is kinda getting impatient at my lack of results on this 8(
Right Click In Datagrid
I am trying to use a shortcut menu and want to be able to select the row and then have the menu pop up. Here is the code for the MouseDown Event that I am using. When I right click the popmenu appears but the row is not selected.
Any help would be appreciated.
If Button = vbRightButton Then
PopupMenu = mTransactions
End if
DataGrid Click
Hi All
I want to display the text from the selected item in the DataGrid. Can anyone tell me why this doesn't work?
Code:
Private Sub DataGrid1_Click()
'DISPLAY TASK IN TEXT BOX
txtTask.Text = DataGrid1.Columns(0).Text
End Sub
When I run this. It does work for the first click. But every click after that it is one selection off, meaning, it will display the previous selection, not the one just clicked.
Any help?
Thanks
Yes/no Click In Datagrid
I have database with a yes/no field. Know I wonder if it is a way to make the datagrid show this field as a checkbox ?
Click On Datagrid
hi i have a datagrid where the data comes from a database, is there a way in datagrid where the user will just click on a cell then the selected text on the cell will transfer to a label or textbox? for example i clicked on column 2 row 2 cell, after clicking the text will transfer to a label
Datagrid Click
I have a datagrid that is bound to a dataset. I what my users to be able to
(1) filter the dataset using their selection from a combobox.(the category is selected from the combobox)
(2) once filtered and displayed in the grid be able to click on the row and that rows data is displayed in textboxs below the grid.
The filtering is working fine, the grid is bound to the dataset prior to being filtered so I see all of the data. When I click on a row the data is displayed in the text boxes below the grid. Which is exactly what I want.
PROBLEM: I select a category (which applys a filter to the dataset) I click a row on the grid..... NO DATA?????????
Any Direction and or help would be appreicated.
chuck
Right Click On Datagrid
G'morning all!
I have a datagrid with a list of names. Currently, I've coded the MouseDown event for right-clicking so that a msgbox appears displaying additional information about the name. However, the user must FIRST (left) click on a name and THEN right-click in order to view the msgbox. Does anyone know of a way to right-click ONLY? That is, eliminate the click event?
Many Thanks!
AMACycle
American Motorcyclist Association
www.ama-cycle.org
Right Click In Datagrid
I am trying to use a shortcut menu and want to be able to select the row and then have the menu pop up. Here is the code for the MouseDown Event that I am using. When I right click the popmenu appears but the row is not selected.
Any help would be appreciated.
If Button = vbRightButton Then
PopupMenu = mTransactions
End if
Sql Datagrid Display
I have this datagrid populated from a table. The table has the following fields :
NameHotel, Period_From, Period_To, price1, Price2
The user should be able to click on the datagrid and the information should come up on labels. The catch is: The same hotel might have more than one period and different periods have different prices 1 and 2 e.g
NameHotel:AnyHotel
period_from 01/01/2002
period_To 27/03/2002
Price1 55
Price2 75
and
NameHotel:AnyHotel
period_from 28/03/2002
period_To 31/12/2002
Price1 65
Price2 85
The dates have been chosen from a dtpicker command, but let´s say the user in
this example wanted four days at price1 from 26/03/2002. that would then be 2 days at 55 and two days at 65.
I would like to have it displayed in the format
NameHotel:
2 days at 55 = 110
2 days at 65 = 130
Total= 240
Any help, please?
DataGrid Display SQL
Using:
VB6.0
MS Access DB
DataEnvironemt
Question:
I have a DataBase with a primary Key of AutoNumbers.
I want a DataGrid to Display all the Records that are Contained in a String.
Example, Instead of the DataGrid Displaying all 1 to 50 Records in the DataBase I want it to Display Records number "1 15 23 37" and those 4 Numbers will be dynamic.
Please tell me what to tell my DataGrid.
Display -ve Value In Datagrid
Hi all,
I am using vb6.0 Access 2003
Is there any way that we can display -ve vaules as -ve values in Datagrid.
Data is the result of a recordset.
The data is result of user input. EX: User looks for amount > 1000 or <-1000 [For amount <0 they enter - sign to indicate]
The program works fine except not displaying -ve sign in front of the -ve amounts.
I know to format currency data.
But it will not display whether it is +ve or -ve value.
Code:
Public Sub DataGridFormat()
Set sfmt = New StdFormat.StdDataFormat
sfmt.Format = "#,###,##0.00"
End Sub
......
Set grdEditAmount.Columns(3).DataFormat = sfmt
Hope some one will help me.
..................
It is displaying amounts with - as prefix for negative values. I don't how i missed it.
Edited by - sreddy on 8/21/2008 11:09:14 AM
Datagrid Click Row And Add To The Excel Row
Hi all,
i put my example here. in this project when i click the cell in datagrid, the records is written in texboxes. and when i click the 'to excel' button all the texbox texts go in the excel cells.
What my problem is after adding one of the row records, i am going to select other row and when i click ' to excel' button the textbox values must be written to empty cell to the bottom of the first row of excel cells which have values.
I mean that every 'to excel' button click first it must look the excel cell if it is empty or not. if it is not empty it must put the records to the empty cell at the bottom.
Can anyone help me how can i do this?
Thanks in advance...
Datagrid And Double Click
Hi,
This is the situation. When I double click on my datagrid I pass the information selected in the grid to several text boxes.
My question is, why when I double click on a datagrid, I actually have to click 3 times to activate the double click event.
I think the problem is the first time I click on the grid, it selects the information in the cell and then I have to double click to activate the event.
How can I change this to activate the double click event the first time a double click on a datagrid? Is it a property I have to set different in the Datagrid?
Thank you...
DataGrid Click Question.
I am using following code to retrieve value of the first column of the selected row. It is woking fine , but when I close the Form, it displays the following error:
Error: "The current row is not available"
Code:
Private Sub DataGrid1_Click()
Dim s
Dim r
r = DataGrid1.Row
s = DataGrid1.RowBookmark(r)
MsgBox DataGrid1.Columns(0).CellText(s)
End Sub
Secondly, when I click on any row, it first displays the row number of the previous click, and then it sets focus on the present clicked row.
Double Click On Datagrid
Hi All!,
I new to VB. I'm writting a school program and would like to do something like this: -
1) When user double click on the datagrid for a specific row, the information will appear in the form which bound with text box.
2) Would like to build a import features coz I have about 6000+ student's and if I key-in one-by-one, would be time consuming and troublesome.
Anyone can help? Thanks and appreciate your time.
Datagrid Click Event
When the Datagrid is double clicked, is there a way to get the adodc to go directly to the record that was clicked on in the datagrid?
I have textboxes that are bound to the adodc, so when a user clicks a record in the datagrid, i want the adodc to go to that record so the text boxes are filled with that information.
Thank you.
Click Event On Datagrid [VB6]
Given a Datagrid [dg] used on a form [frmMain].
Currently I have the following mechanism setup for the DoubleClick event and everything works fine, let me explain.
The user DoubleClicks on a Row (the indicator arrow on the left margin of the grid moves to that row) and the information in the datagrid is loaded into an interface. This works great however it would be much better if the event was on Click and not DoubleClick because currently users will Click on a Row (and the indicator arrow on the left margin will move accordingly) but no data is loaded and this often confuses users who believe the data loaded corresponds to the indicator arrow of the grid.
Hopefully my explanation above was clear enough.
The problem at hand is the following (when using the Click event instead of DoubleClick). I have noticed that the click event seems to lag by one row, specifically when I click on row0 the indicator moves to row0 but nothing is loaded (dg.columns is empty), then if I Click on row1 the indicator moves but the information from row0 is loaded, etc…
And no matter what, my first Click on the Datagrid always loads the record at row0 even if my 1st click in row1000, this I assume is because the 1st click is like selecting the Datagrid itself however this leads to a lot of confusion also.
I have been reading and it may be because the Click event starts on MouseDown and ends on the next MouseDown (I may be wrong about this but cannot find any other reason). I tried using the MouseDown event itself and get the same behavior.
Any clues or help would be appreciated.
If you think you know but my description was too horrible please ask me to clarify.
This has been an ongoing issue for almost a year.
Click Event Of A Datagrid
OK I have two final questions before I think I have the project I'm working on sorted.
1. There is a click event for the datagrid control; is it possible to detect which row or even which cell has been clicked? If so how?
2. Is there a way of formatting the text within a cell - I want one of the columns to have underlined text.
If either of the above are not possible with a datagrid control are there any other similar controls that it is possible?
Hope you can help.
DJ
DataGrid Help Using Something Other Than Click Or Doubleclick
I have a DataGrid on a form. The user can doubleclick a row and pull up that record. The boss now wants to add the ability for the user to select a row and change the data in 2 of the columns. I can do this by adding this to the click
DataGrid1.Columns(4).Text = "1"
DataGrid1.Columns(5).Text = Date
It works fine but thinking about the user making mistakes I need to use another way other than the click()
Is it possible to code it such that the user must hold down a key on the keyboard then select the record that will have the above inserted into it ?? That way I eliminate any problems between his click and doubleclick. I would appreciate any help with the code for this. If possible I would like to use the P key since it is marking that record paid and the date it was paid.
Thanks for any and all help.
Datagrid Double Click
Hi Guys,
I am new to VB database and need your help. I am creating a small customer and product database. After populating a datagrid with, say, customers name and address, i would like to doubleclick on a particular name and open up a form with more details of this particular customer. How do i get the system to select that specific record. Please explain in detail as i am new to Vb DB. CHeers!!
Double Click Datagrid..??!!
i wonder where i did wrong..
from the database, all the data display on datagrid...
and when i double click on one of the row, it will display the all related current data on the text box..
but when i scroll the datagrid and double click again, it will display the others data...
why like this..???
Datagrid Row Click Event
hi. im new in vb6 programming and i have this problem in datagrid.
also, is there a way for me to get the row number and its contents on a textbox by left-clicking on the row?
thank you
How To Display A Check Box In A Datagrid
Hi,
I need your help.
I have a datagrid control that bind to a table. There are 3 columns bind to a Y/N column which datatype is char(1).
How can I display those columns in the datagrid as checkbox?
Thank you so much,
ConKi
Display Record Set In Datagrid??
Hi I have the code below that queries a database and creates a recordset from it. The code then puts the FirstName value of the record into a textbox. However I also want to display all the records queried in a datagrid. How do I alter the code to allow me to do this? I have a data grid on the form called datDataGrid.
Any help would be greatly appreciated.
Thanks.
Ben.
'Declares the recordset globally for this form
Dim MyRecSet As ADODB.Recordset
-------------------------------------------------------------------
Private Sub btnNext_Click()
' Moves to next record
MyRecSet.MoveNext
' Puts the FirstName value of the first record into a textbox
Me.txtName.Text = MyRecSet.Fields.Item("FirstName")
End Sub
-------------------------------------------------------------------
Private Sub Form_Load()
Dim MyConn As ADODB.Connection
Dim strName As String
'Creating the connection
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=C:Documents and SettingsBenDesktopWADE2CourseworkDatabasehogwarts.mdb;"
MyConn.Open
' Creating a recordset from a query
Set MyRecSet = MyConn.Execute("SELECT FirstName, FamilyName FROM Character")
' Puts the FirstName value of the first record into a textbox
Me.txtName.Text = MyRecSet.Fields.Item("FirstName")
' This needs to go at the end because if it is before the selection
' of data from the recordset then it doesn't work.
' MyConn.Close
End Sub
Display In DataGrid Control
Hello everyone! First of all, I apologize profusely if this post makes little sense. It's late and I'm sooooo tired and this silly problem is not helping any.
Anyway, here goes:
I have a Data Grid Control on my form called dgdHistory and Adodc callled adoHistory. My problem is that I have tried to link the Adodc control to my Data Grid Control to display the records but it does not display any records. I know it is pulling and working with the recordset because it calculates the correct totals at the end, but no records are displayed in the Data Grid Control.
Code:
rs.Open strSQL, sConn, adOpenKeyset, adLockPessimistic, adCmdText
With adoHistory
.ConnectionString = sConn
Set .Recordset = rs
End With
Set dgdHistory.DataSource = adoHistory
dgdHistory.Refresh
With adoHistory
Do Until rs.EOF
sngCostTotal = sngCostTotal + rs.Fields("TotCost")
sngRateTotal = sngRateTotal + rs.Fields("TotRate")
intTotMin = intTotMin + rs.Fields("Duration")
rs.MoveNext
Loop
End With
Can anyone see what I am doing wrong?
Datagrid:need To Display Enough Cells
Hi all,
I ran a query and return 0 record, the datagrid only display one blank row.
I like to find out if there is a way to default several blank grid cells when there is no record found?
Thanks in advance
Kim
SQL Searching & Datagrid Display
Hello
I have a program that will print the contents of a datagrid and all works well, I just cannot figure out how to fix my search code.
http://img511.imageshack.us/img511/3760/scottsvx0.jpg
I am trying to make it so when the user clicks "Command1" it will filter out anyone who doesnt have "Box Type" 1 and only show those who do.
The way my code is right now, when i open the debug window, the button does give an output of 1 but it doesnt filter the information shown in the datagrid.
Here is my code:
Code:
Private Sub Command1_Click()
strSQL = "SELECT * "
strSQL = strSQL & "FROM hamper "
strSQL = strSQL & "WHERE [Box Type] = 1 "
strSQL = strSQL & "ORDER BY Forename;"
Dim cn As New adodb.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:databasescotts2.mdb"
cn.Open
Dim rs As New adodb.Recordset
Set rs = cn.Execute(strSQL)
With rs
Do While Not .EOF
Debug.Print (.Fields("Box Type").Value)
.MoveNext
Loop
.Close
End With
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
DataGrid Display Question
VB 6 Enterprise, OS = Windows XP Pro
Scenario:
I have a DataGrid that is read only. It can have any number of records(rows). The current "Display" allows 25 rows visible. Therefore, if I have more than 25, I need to use the scrollbar.
I worked out a routine that will print the contents of the complete DataGrid. For example, if the record count = 80, I will get 4 pages of printout ( 3 pages, each showing 25 records, and a 4th page with the balance (5 records),
Problem:
The last page will not only show the last 5 records but it will show the previous 20 (20 + 5 = rows visible).
Question:
Is there any way just to show the last 5 record on the datagrid?
The Code:
' RecordCount = adoTrackSort.Recordset.RecordCount is done in a different sub routine
cdPrint.ShowPrinter
Printer.Orientation = vbPRORLandscape
If RecordCount > 25 Then
ScreenCount = Round((RecordCount / 25), 2)
ScreenCount = Round(ScreenCount)
CountDiff = RecordCount - (25 * ScreenCount)
Else
ScreenCount = 1
End If
If ScreenCount >= 1 And CountDiff > 0 Then
HoldScreenCount = ScreenCount + 1
End If
If ScreenCount >= 1 And CountDiff = 0 Then
HoldScreenCount = ScreenCount
End If
ScreenCount = 1
RowPosition = 1
Do Until (ScreenCount + 1) > HoldScreenCount
' Me.PrintForm
DoEvents
RowPosition = RowPosition + 25
ScreenCount = ScreenCount + 1
dbgTrackSort.Scroll 0, 25
DoEvents
Loop
dbgTrackSort.Scroll 0, (RecordCount - CountDiff + 1)
Me.PrintForm
DoEvents
Call MsgBox("You have " & HoldScreenCount & " Pages of printout for this report.", vbInformation, "Report Pages")
Thanks,
Sam
How Do I Display This Report(datagrid)
i would just like to ask if there is a way to display a whole report plus its "relationship" from the other database table.
im using vb6 and ms access for storage.
datagrid for displaying the data's
if yes please give me some sample of codes so i can have an idea.
Display Records In Datagrid And Others
HI
I want to be displayed records in datagrid. i tried it using given code but it gives error like "rowset in not bookmarkable"
rs3.Open "select * from billauto", cn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rs3 ' here it gives error
datagrid1.refresh
and i want to update,delete addnew records directly from datagrid
Please help me
waiting for reply
Thanx a lot
Display Records In Datagrid
hi all,
i want to type some name in my textbox. when i start type something ( i feel in textchange itselft) the datagrid should fill with those records from the table starting with letter i typed in the text box. how can i go about. which grid control is best suit here. i need some suggestions. and the beginning code if possible.
another query is can i able to display the records of two tables in a grid
thanx in advance
saj
ADO - Display Datagrid Or Mshflexgrid
Hello All,
I am using ADO with Access databse.How can I show records of below query in Datagrid or mshflexgrid ? There can one record as well as multiple records against unique mp.regnonew, so I want to display those records. How to set this query to adodc1 when I want to fetch record against unique mp.regnonew.
VB Code:
"SELECT mp.regnonew, pvd.visano, mv.visatype, pvd.visaissuedt, pvd.visavaliddt, pvd.visaissueplace FROM mas_passenger AS mp, pass_visadetail AS pvd , mas_visa AS mv WHERE mp.passid = pvd.passid AND mv.visaid = pvd.visaid AND pvd.deleted = no AND mp.regnonew = '" & lstregno.List(lstregno.ListIndex) & "'"
How To Display A Checkbox In Datagrid
Good morning.
I have a datagrid that bind to a table. The table has 1 column which contains data as either Y or N and has datatype char(1).
How can I present this column in the datagrid as a check box?
In the design time, the property of the datagrid only allow a checkbox that bound to a boolean type col but there is no such a boolean type in SQL Server.
Thank you for your help.
ConKi.
Datagrid Won't Display Data
Set con = New ADODB.Connection
con.ConnectionString = "File Name=" & mstrDatabasePath
'mstrdatabasepath = "C: est.udl"
con.Open
Set rst = New ADODB.Recordset
rst.Open txtSQLString.Text, con, adOpenStatic, adLockOptimistic, adCmdText
Set dbgoutput.DataSource = rst
It just stopped working all of a sudden, syntactically I didn't change anything. The weird thing is I can generate XML, delimited, and HTML based upon the SQL taken from the textbox.
Any idea what might cause this?
How To Display The Particular Record In Datagrid : Vb 6.0
Hi all,
Can anyone tell me how to get a record for particular user or Number
In my sql i,v Pinvoice table following fields
InvNo int1001
ItemNo
001
002
003
Descrption varchar(20)Fan
Chair
Table
Price float
90
100
20
Qty
2
5
10
Gross
180
500
200
so my question is if type the InvNo(1001) in a textbox this all Records(ItemNo,Descrp,Price,Qty,Gross) i need to display in a grid if i type the another Invno then it has to show me the corresponding InvNo whch i specify in the same grid and in below the Grid i need the total for theGross amount , so can anyone tell me how to do this
Problem In Datagrid Display : Vb 6.0
Hi all,
Can anyone tell me how to get a record for particular field, in sql i,v Pinvoice table following fields
InvNo int ItemNo int
Descrption varchar(20) Price float Qty Gross float
1001
090
Fan
30
5
150
1001
080
Table
45
2
90
1002
012
Chair
90
3
270
1002
001
ToolBox
120
1
120
now t want to see the particular invNo details in a datagrid when i type the particular invNo ina Textbox (for example if i type the InvNo -1001 in that textbox the grid shows that 1001 details) what should i do to get the result.
in button click i used this query
sqlstring
sqlstring = "select ItemNo,Descrp,Rate,Qty,Gross from Pinvoice where InvNo=& txtTest.Text"
Adodc1.RecordSource = sqlstring
Adodc1.Refresh
1. "Microsoft[ODBC Driver manager]datasource name not found" so i droped it.
2."Incorrect syntex near&"
3.Method 'Refresh' of object 1Adodc failed"
so i used this way
1. in a Adodc control Recordsource command type AdcmdText i added the following code select ItemNo,Descrp,Rate,Qty,Gross from Pinvoice where InvNo=&
it showed me error msg Incorrect syntex near&" as well page loading & close
so i tried to give the datasource at run time, in a button click event i added this query
plz help me to solve this problem
Display Record On Datagrid
how to display all my records on datagrid ?
i already make the datagrid on my form ( from selecting datagrid component ). but how to define its query source
( i'm using odbc mysql conn) - should i place another component ? what i have to do to make the datagrid display the result of my executed query ?
thanks in advance...
Display Records In Datagrid And Others
HI
I want to be displayed records in datagrid. i tried it using given code but it gives error like "rowset in not bookmarkable"
rs3.Open "select * from billauto", cn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rs3 ' here it gives error
datagrid1.refresh
and i want to update,delete addnew records directly from datagrid
Please help me
waiting for reply
Thanx a lot
DataGrid Display Problem
is there any solution?
Hi
I am using VB, COM+/MTS, ORACLE for application. In VB, to update the records I am using DataGrid with the combination of ADODC.
Table structure is as below
ITEM_MST Table
CODE
BRAND
DESCRIPTION
ORDER_MST Table
CODE
ITEM_CODE
QTY
UOM
Code:
Set objclsPR = New clsPR
Set ADODC1.Recordset = objclsPR.GetRecorset(dblCode)
Set objclsPR = Nothing
DataGrid1.DataSource = ADODC1
Quote:Class Module
Public Function GetRecorset(Optional ByVal Code As Double) As ADODB.Recordset
On Error GoTo errHandler
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
strSql = "SELECT * FROM ORDER_MST "
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
Set cn = New ADODB.Connection
cn.ConnectionString = CONNECT_STRING
cn.Open
rs.Open strSql, cn, adOpenDynamic, adLockOptimistic
Set rs.ActiveConnection = Nothing
Set GetRecorset = rs
Set rs = Nothing
cn.Close
Set cn = Nothing
If Not mobjCtx Is Nothing Then mobjCtx.SetComplete
Exit Function
errHandler:
If Not mobjCtx Is Nothing Then mobjCtx.SetAbort
End Function
clsPR is class, objclsPR.GetRecorset is returning the recordset and this recordset i am binding with DataGrid.
I have 6 columns in DataGrid for display.
1.Code
2.Item Code
3.Brand
4.Description
5.Qty
6.UOM
I donot have any problems with columns Code, Item Code, Qty. My Problem starts with BRNAD and DESCRIPTION.
How do I show the BRAND and DESCRIPTION against the selected ItemCode?
If need more explanations, pls ask.
KT
Edited by - Kshitij on 1/28/2004 6:05:11 AM
DataGrid-Display Problem
Hi,
Iam using DataGrid in my application to display the search results.
with Database as MsAccess.
i have used code like this
rsVS.Open "select Voter_ID, Name, Father_Name, Village, Taluk from PersonnalDetails1 where ID between val(me.txtFrom.text) and val(me.txtTo.text) ", dbVS, adOpenStatic, adLockOptimistic
Set Me.DataGrid1.DataSource = rsVS
I have my data base column declred as Number
The error message iam getting as Too Few Parameters Expected3
Thanx
Problem With Datagrid Display
im using an adodc to display sql queries in the datagrid...this is the sql i use to get my data
SELECT @total:= SUM(i.itemQty) FROM invoiceItemTable i, invoiceTable t, partsTable p WHERE i.itemNum = p.partID AND i.invID = t.invID;
SELECT p.partName as 'Item', SUM(i.itemQty) as 'Quantity', CONCAT((ROUND((SUM(itemQty)/@total)*100)),'%') as 'Percent' FROM invoiceItemTable i,partsTable p WHERE i.itemNum = p.partID AND i.invID = t.invID GROUP BY p.partName;
my concern is that i can't seem to display the third column of my query which is suppose to be the percentage...so far the first two columns of the query displays normally...and i doubt my query is wrong because when i use the same query to print it in the data report...it works fine...
so my question is...why can't i display the thrid column in the datagrid? is there some formating required or something? as far as i know sql queries only return strings right? so there should be no problem in displaying in the grid....
|