Solved

DBGRID Col and Row

Posted on 2002-07-26
4
809 Views
Last Modified: 2012-06-21
How do you determine cell, data DBgrid ?
For example if I press enter
in one off many cell in bound grid
then how do i know it's row and it's col.
And How to place a combo to Dbgrid without
third party (Just using trick)
0
Comment
Question by:ekohartono
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 10

Expert Comment

by:aeklund
ID: 7180266
You can use this to determine which cell and row you are currently in:

Private Sub DBGrid1_KeyPress(KeyAscii As Integer)
  Debug.Print DBGrid1.Col
  Debug.Print DBGrid1.Row
End Sub

0
 
LVL 4

Expert Comment

by:gencross
ID: 7180279
In the cell change event use...

lCol = grddatagrid.Col
lRow = grddatagrid.Row

I don't think you are going to be able to place a combo in the dbgrid.  What exactly are you trying to do?
0
 

Author Comment

by:ekohartono
ID: 7180308
thank you for the answer guys.....

date | code | Item | price | total |

in code column i wanna place a combo so just choose  a list of code hope this helps
0
 
LVL 2

Accepted Solution

by:
yongyih earned 50 total points
ID: 7180312
I do this using MSFlexGrid.  May be you can apply it in DGGrid

Sub setTextBox()
    With txtGridData
      .Visible = True
      .Top = listOfSales.Top + listOfSales.CellTop
      .Left = listOfSales.Left + listOfSales.CellLeft
      .Width = listOfSales.CellWidth
      .Height = listOfSales.CellHeight
    End With
End Sub


Private Sub listOfSales_Click()
  setTextBox
End Sub


Private Sub txtGridData_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        listOfSales.TextMatrix(listOfSales.Row, listOfSales.Col) = txtGridData.Text
        txtGridData.Visible = False
    End If
End Sub

Hope this can help. Good luck.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question