Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2005, 01:02 AM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default I can't Click my MSHFlexGrid...

This is my function to Highlight my grid

Public Function HighLightRow(grd As MSHFlexGrid)
    grd.RowSel = grd.Row
    grd.Col = 0
    grd.ColSel = grd.Cols - 1
End Function

but right after I execute this command, the problem started. I can't click on my Grid. I'm having trouble selecting the rows. Anybody could help me??? By the way I put all this function in Class.


Public Function Supervisor_Search(Grid As MSHFlexGrid, Field As String, KeyWord As String)

    SQL = "select * from tblSupervisor where " & Field & " like '" & KeyWord & "%' order by Supervisor_Lastname"
    rs.Open SQL, conn
    Set Grid.DataSource = rs
    rs.Close

End Function



 
Old January 24th, 2005, 09:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

since you pass a rs to your grid, and then you close it, it's closed to the grid too...

you have to maintain it open to make your grid still work...

HTH

Gonzalo
 
Old March 15th, 2005, 03:47 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zaheer131 Send a message via Yahoo to zaheer131
Default

Quote:
quote:Originally posted by mac_ware23
 This is my function to Highlight my grid

Public Function HighLightRow(grd As MSHFlexGrid)
    grd.RowSel = grd.Row
    grd.Col = 0
    grd.ColSel = grd.Cols - 1
End Function

but right after I execute this command, the problem started. I can't click on my Grid. I'm having trouble selecting the rows. Anybody could help me??? By the way I put all this function in Class.


Public Function Supervisor_Search(Grid As MSHFlexGrid, Field As String, KeyWord As String)

    SQL = "select * from tblSupervisor where " & Field & " like '" & KeyWord & "%' order by Supervisor_Lastname"
    rs.Open SQL, conn
    Set Grid.DataSource = rs
    rs.Close

End Function



 
Old March 15th, 2005, 03:50 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zaheer131 Send a message via Yahoo to zaheer131
Default

Quote:
quote:Originally posted by mac_ware23
 This is my function to Highlight my grid

Public Function HighLightRow(grd As MSHFlexGrid)
    grd.RowSel = grd.Row
    grd.Col = 0
    grd.ColSel = grd.Cols - 1
End Function

but right after I execute this command, the problem started. I can't click on my Grid. I'm having trouble selecting the rows. Anybody could help me??? By the way I put all this function in Class.


Public Function Supervisor_Search(Grid As MSHFlexGrid, Field As String, KeyWord As String)

    SQL = "select * from tblSupervisor where " & Field & " like '" & KeyWord & "%' order by Supervisor_Lastname"
    rs.Open SQL, conn
    Set Grid.DataSource = rs
    rs.Close

End Function


for this purpose dont use this function
just do this in the properties panel
property named as "selectionmode" just click on it n select selection by row
n if u wana to select the first colum as well so add another column in the grid n make its widht zero so it become invisible n grid selection look like from the first coloumn :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Right-Click or Double-Click Combobox? panuvin C# 2005 3 June 15th, 2006 04:30 PM
mshflexgrid kolani VB Databases Basics 0 September 28th, 2005 05:54 PM
mshflexgrid kolani Beginning VB 6 0 September 28th, 2005 05:09 PM
MSHFlexgrid slgknjn Beginning VB 6 4 February 25th, 2005 04:07 PM
mshflexgrid jothi Pro VB 6 1 August 12th, 2004 03:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.