Full Version: FlexGrid/MouseDown works in VB 6.0, but does not work in Access
UtterAccess Forums > Microsoft® Access > Access Forms
titus1429
I am working with FlexGrid control. I have a code snippet that works fine on Visual Basic 6.0, but doesn't work in MS Access 2000. I can't figure out the problem or solution. Can someone clarify for me and if there is a solution to this functionality for Access 2000.
The basic function is to click on any cell in the FlexGrid and a message box will appear with current row and column position. The Mouse Down is the function that is in contorl of the mouse. Which is the very essense of this problem.
Thanks
code snippet attached.
Girn13
I'm using 2002 sp-2 and when I added mousedown to my flexgrid it produced this
Private Sub InvGrid_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Ocopied your code, changed where appropriate and it ran fine. I'd suggest commenting out your code from VB 6.0 and let Access generate the MouseDown Sub and see if it differs from VB.
titus1429
It worked fine for me too!Awesome...thanks man!!!
titus1429
I thought I had this thing figured out, but the following function is blowing up on the Icon and Drag portion of the code. The purpose of this function is to move, but it is not recognizing the dragIcon and drag commands. It works fine with VB6.0, but is blowing up in Access. Any insight here?
Private Sub MSFlexGrid1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
Dim strPath As String
strPath = "C:\Projects\Proj\box.ico"
If Button = 1 Then
DragText = MSFlexGrid1.TextMatrix(MSFlexGrid1.row, MSFlexGrid1.col)
MSFlexGrid1.DragIcon = LoadPicture(Pic) ' load picture.
MSFlexGrid1.Drag

End If
End Sub
Girn13
I looked in the object browser and my version of Flexgrid has no Drag or DragIcon members. They might be specific to VB.
titus1429
http://msdn.microsoft.com/library/default....idControl_M.asp
This article says that there is the Drag method and DragIcon. But they are not working at all. Do you know if this is version specific for the MSFlexGrid?
thanks
Girn13
I still find no reference to Drag and DragIcon. All I can assume is that the versions I'm working with are not up to date. If you have them in VB then I'd suggest adding a refeerence to the VB MSFlexGrid.ocx to your Access app and see if that does it.
Sorry, that's my best shot at this point.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.