[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

datacombo on the datagrid (help)...urgent

Posted on 2000-03-08
2
Medium Priority
?
186 Views
Last Modified: 2010-05-02
i want to move the datacombo(it is on the 3rd col on the datagrid) on the col up and down,and it should appear only on the cell which is clicked by the user otherwise it should remain visible false
datagrid is connectd to a table thru adodc
i am tried the following code
DataGrid_mousedown event
If DataGrid1.ColContaining(X) = 4 Then
   'Dim DY, DX, RowValue, ColValue, CellLeft, CellTop
    ColValue = DataGrid1.ColContaining(X)
    RowValue = DataGrid1.RowContaining(Y)
    'Get the height of the cell.
    DY = DataGrid1.RowHeight
    'Get the width of the cell.
    DX = DataGrid1.Columns(ColValue).Width
    CellLeft = DataGrid1.Columns(ColValue).Left
   
    CellTop = DataGrid1.RowTop(RowValue)
   
    CellLeft = CellLeft - DataGrid1.RowHeight
    DataCombo1.Left = DataCombo1.Left + CellLeft - 1050
    DataCombo1.Top = DataCombo1.Top + CellTop - 160
    DataCombo1.Width = 2865
    DataCombo1.Height = 315
    DataCombo1.Move DataCombo1.Left, DataCombo1.Top, DataCombo1.Width, DataCombo1.Height
    DataCombo1.Visible = True
 End If
0
Comment
Question by:bindu10
[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
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 180 total points
ID: 2597263
Add a ListBox and make its visible property to False.


'Add this code to the form declaration

Option Explicit
Dim intColIdx As Integer
 'This will contain the index for the current  cell in the dbgrid
Dim blnListShow As Boolean 'is the list showing or not


Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
Dim intTop As Integer
intColIdx = ColIndex
If blnListShow = False Then 'if the list is not showing then...
blnListShow = True
List1.Left = DBGrid1.Columns(ColIndex).Left + 360
intTop = DBGrid1.Top + (DBGrid1.RowHeight * (DBGrid1.Row +2))
 List1.Top = intTop
 List1.Width = DBGrid1.Columns(ColIndex).Width + 15
                     List1.Visible = True
                  List1.SetFocus
Else 'if the list is show, hide it
             blnListShow = False
              List1.Visible = False
End If
End Sub


          Private Sub Form_Load()
                blnListShow = False 'initialize
           End Sub

        Private Sub List1_Click()
DBGrid1.Columns(intColIdx).Text = List1.Text
 'set the value of the dbgrid
  List1.Visible = False 'hide the list
        End Sub

                      Private Sub List1_LostFocus()
                          blnListShow = False
                          List1.Visible = False
                      End Sub
0
 

Author Comment

by:bindu10
ID: 2602944
thanxs emoreau,for your timely support
mathew
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

650 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