| Want a help in visual basic programming?

Want a help in visual basic programming?

suga asked:


‘Fd1 and sele2 are string variables for feild names
‘rs is the record set Access database
‘DB1 is a msflexgrid

fd1 = (”TC” + sele2)
While Not rs.EOF
If rs.fd1 = sele3 Then
DB1.Rows = row + 2
scid = rs!SchoolID
DB1.TextMatrix(row, 1) = scid
DB1.TextMatrix(row, 4) = rs!TC01
DB1.TextMatrix(row, 5) = rs!TC26
row = row + 1

error masage object does not support
want help to correct this error

Related posts:

  1. Visual Basic programming query? Yashu asked: I am getting the following compile error msg...

Filed Under Programming & Design |

Tagged With , ,

Comments

2 Responses to “Want a help in visual basic programming?”

  1. dhvrm on May 14th, 2009 2:25 am

    Which object is creating the error? The error message tells you that. Or, what method is in error? The error message tells you that, too.

  2. Mark G on May 17th, 2009 11:53 am

    First I assume you have properly sized the flex grid using the ROWS and COLS property to size the grid

    The text matrix property is expecting a string. Try reading field data into string variables converting datatypes as necessary.

    I preferr to index through a recordsets the fields property. Here is an example which also converts to a string variable

    Dim myStr as String
    myStr = CStr(rs.fields(index).value)

    You can create an enumerated list of field names

    PUBLIC ENUM myTblFlds
    scid = 0
    TC = 1
    ect…
    END ENUM

    This will enhance readability:

    myStr = CStr(rs.fields(scid).value)