Solved

DBGRID Col and Row

Posted on 2002-07-26
4
819 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month6 days, 3 hours left to enroll

627 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