Computing.Net > Forums > Programming > vb mshflexgrid doubt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

vb mshflexgrid doubt

Reply to Message Icon

Name: john
Date: November 21, 2002 at 21:17:32 Pacific
OS: win 98
CPU/Ram: 64 MB
Comment:

friends i hav doubt in vb, pls help!

when a user clicks on a particular cell, i want to get the column and row of that cell.

for ex. (1,1) or (4,9)

and how can i make mshflexgrid cells editable, ie user can edit & enter some value

pls reply



Sponsored Link
Ads by Google

Response Number 1
Name: HiJinx
Date: November 21, 2002 at 22:07:15 Pacific
Reply:

If your control is named "Flex"...

To get the column and row, and then to let the user enter/edit the value, the following snippet should be enough to get you started...

Private Sub Flex_Click()

MsgBox "(" & Flex.Col & "," & Flex.Row & ")"

Flex.Text = InputBox("Enter Value", "New Value", Flex.Text)

End Sub

Not sure if you can edit directly within the cell...


0

Response Number 2
Name: john
Date: November 21, 2002 at 22:39:24 Pacific
Reply:

lets keep control name is flex

when i give command

msgbox(flex.row) it works and give me the currrently pressed row

but the command msgbox(flex.col) works but always it gives the result as 1.

one more thing, when

msgbox(flex.row) is written it changes to

msgbox(flex.Row), r change to capital r b'coz it Defined in flexgrid

but the same thing doen't happen with col

msgbox(flex.col) remain to flex.col

but other col property works.

so plz reply.

anyway thanks for ur response



0

Response Number 3
Name: HiJinx
Date: November 21, 2002 at 23:00:58 Pacific
Reply:

Don't know what to tell you... yours isn't behaving like mine. I'm using VB6 with ServicePack 5. Maybe you have a different version. If you don't have a .col property, you should be getting an error instead of always a value of 1.

Check your help for the flexgrid control. Maybe you need different syntax.


0

Response Number 4
Name: john
Date: November 22, 2002 at 00:43:27 Pacific
Reply:

Thanx for ur reply

But i checked for the command, but it is the same.

Ok, can u say me how to connect DBGrid to backend(access) -- programmitically

Pls reply

bye


0

Response Number 5
Name: HiJinx
Date: November 22, 2002 at 14:35:02 Pacific
Reply:

Well, I've never used the DBGrid, but I just played with it for a minute and it looks like you'd do something along the lines of:

-create a database using Access.

-add a data control to your form (not the ADO one, though).
-set the "DatabaseName" property
-set the "RecordSource" property to the table you want

-add the DBGrid to your form
-set its "DataSource" property to the name of the data control

That's enough to get you started. Have fun.


0

Related Posts

See More



Response Number 6
Name: john
Date: November 24, 2002 at 23:26:14 Pacific
Reply:

Hey HiJinx, u r saying to use datacontrol, but i want to use only datagrid nothing else.

And i tried to do with datacontrol too, but when iam setting database in desgin time it so some error as invalid database.

Iam connecting to Access.

Note: that connect property of Data Control is Access


0

Response Number 7
Name: HiJinx
Date: November 25, 2002 at 21:56:43 Pacific
Reply:

You could maybe try Access 2000 from the drop down list instead of just Access. But whatever problems are preventing you from connecting the db with the data control are likely to come back if you try connecting through code.

Sorry I couldn't have been of more help.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Convert a ( .BMP) into bi... Run java apps by double-c...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: vb mshflexgrid doubt

Vb Print Doubt www.computing.net/answers/programming/vb-print-doubt/4015.html

vb event doubt www.computing.net/answers/programming/vb-event-doubt/4594.html

Vb Print Doubt www.computing.net/answers/programming/vb-print-doubt/4629.html