![]() |
|
#1
|
|||
|
|||
![]()
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 Code:
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 Public Sub UserForm_Initialize() TableSelected = "" cbTables.Clear '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 rsTables.MoveNext Wend 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. thanks |
#3
|
|||
|
|||
![]()
retables is in the global module table and PUBLIC...
here is it where i have declared. Option Explicit Public nUserUnit As Integer Public dRefX, dRefY, dRefX1, dRefY1 As Double Public dLeftRightMargin, dTopBottomMargin As Double Public dXCoord, dYCoord As Double Public dFontSize As Double 'Dim dFontface As FontList Dim sFileName As String Public c As Color 'Dim dhalignment As cdrAlignment 'Dim dvalignment As cdrVerticalAlignment Dim iFile As Integer, FileName As String Dim DBFILE As String Dim oform As TableSelectForm Public strLog As String Public CurRecord As Long 'Public sArray() As String Dim txtalignment As cdrAlignment Public Records As Collection 'declaring an instance for tableform ' rstables variable delcared and public.... Public rsTables As ADODB.Recordset Public TableSelected As String 'Collection Variables Dim collPages As Pages Dim collShapes As Shapes Dim sLabel As Shape what am i doing wrong. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CDR12: refresh Object Manager docker after CreateSelection | zlatev | CorelDRAW/Corel DESIGNER VBA | 2 | 05-03-2005 10:00 |
Bounding lines around an object | toy4mud | CorelDRAW CS | 2 | 04-11-2004 12:56 |
Sorting entries in the object manager | dan | CorelDRAW/Corel DESIGNER VBA | 1 | 18-08-2004 23:16 |
Would you miss CorelScript object? | Alex | CorelDRAW/Corel DESIGNER VBA | 32 | 04-02-2004 15:59 |
Stroke Object Script NOT found in MegaGallery9 | vallentin | Macros/Add-ons | 0 | 23-11-2003 21:27 |