|
-
Aug 24th, 2004, 03:45 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Passing A Flexgrid To A Function
I'm having problems doing this:
I have a MSFlexgrid sitting on a tabbed form named "grdTrans" and a disconnected recordset "rs".
When I pass this grid to a module function "PopulateGrid(ByRef oFlxGrid as MSFlexGrid, ByRef rs as ADODB.Recordset) " it doesn't work.
Seems like the grdTrans object is only viewed as a zero length string or something rather than an object. The recordset seems to be ok.
I tried "Call PopulateGrid (grdTrans, rs)" as well as "Call PopulateGrid(Me.grdTrans, rs) both with no luck.
Can you pass objects to functions in VBA?
-
Aug 24th, 2004, 05:21 PM
#2
What do you mean by it doesn't work? Do you get an error? Do you not get what you expect? How do yo uknow it's not working?
Also, can you post the code that's "not working?" -- would be a little easier to understand what you are doing.
Tg
-
Aug 25th, 2004, 07:50 AM
#3
Thread Starter
Hyperactive Member
I know it's not working because:
"Seems like the grdTrans object is only viewed as a zero length string or something rather than an object."
It's not an object, it has no properties to work with, it comes as a string with no length ----"". That's all i see.
And of course it will error out if you set up your code to handle objects rather than strings.

I got the problem down to this: When I try to use VB controls like a combo box or MSFlexgrid , the properties such as addItem and RemoveItem, TextMatrix, Col, Row, etc of the control is not listed and hence it gives a compilation error.
I would like to know what the action to be taken to get the properties identified.
Last edited by rplcmint; Aug 25th, 2004 at 08:31 AM.
-
Aug 25th, 2004, 09:08 AM
#4
Thread Starter
Hyperactive Member
-
Oct 22nd, 2004, 04:20 AM
#5
Member
Simple response
There should be a simple response to this. I used to have this problem with non-VBA controls in MSAccess and not seeing their properties or passing them to functions, but there is an answer.
VB Code:
Dim g as MSFlexGrid
Set g = g.Object
call PopulateGrid(g,rs)
Hope that helps
-
Oct 22nd, 2004, 05:13 AM
#6
Member
*************** Error *********
Sorry that should have read
VB Code:
Dim g as MSFlexGrid
Set g = grdTrans.Object
call PopulateGrid(g,rs)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|