OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 21-11-2004, 16:48
Posts: n/a
Default object variable not found

i am trying to call a form from another form
here is a piece of code of what i am doing

there is a form called changetext. in the code i am trying to call another form

Private Function ImportExcelFile(ByVal DBFILE As String) As Collection
    Dim col As New Collection
    Dim rec As clsDataRecord
    Dim cnn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim s As String
    Dim i As Integer
    'Dim oform As Object
    'Set oform = New TableSelectForm
    ' Open the connection to an Excel file
     cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
             "Data Source=" & DBFILE & ";" & _
             "Extended Properties=""Excel 8.0; HDR=No; IMEX=2;"""
    Set rsTables = cnn.OpenSchema(adSchemaTables)
       'here is where i call the tableselcetform 
TableSelectForm.Show vbModeless
it goes to the useer form intialise method whose code i have it as

Public Sub UserForm_Initialize()
TableSelected = ""

'after thsi statement i get the error
While Not rsTables.EOF
If rsTables![TABLE_TYPE] = "TABLE" Then
' Enumerate tables only; omit views, etc.
cbTables.AddItem rsTables![TABLE_NAME]
End If

If cbTables.ListCount > 0 Then
' Select the first item
cbTables.ListIndex = 0
End If
End Sub

as soon as it goes into rstables.EOF it does not find anything in it and it give an error saying
Run time error 91
object variable or with block variable not set
i have set rstables as public or ado recordset type in form change text

i dont know what is wrong
any idea some one.

Attached Images
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CDR12: refresh Object Manager docker after CreateSelection zlatev CorelDRAW/Corel DESIGNER VBA 2 05-03-2005 09:00
Bounding lines around an object toy4mud CorelDRAW CS 2 04-11-2004 11:56
Sorting entries in the object manager dan CorelDRAW/Corel DESIGNER VBA 1 18-08-2004 22:16
Would you miss CorelScript object? Alex CorelDRAW/Corel DESIGNER VBA 32 04-02-2004 14:59
Stroke Object Script NOT found in MegaGallery9 vallentin Macros/Add-ons 0 23-11-2003 20:27

All times are GMT -5. The time now is 02:12.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com