Results 1 to 2 of 2

Thread: Long Thread, sorry

  1. #1

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444
    First thank you to Martin Liss for all the help and to the other who have replied to my other threads.
    I am using mdi child forms. each is a copy of the original.
    I have a database with a formatted table.
    on each creation of a new child form I create a new table. This new child form should point to the new table. I am using a data control Data1 and a DBGrid control.
    Each table/form represents an electrical panel schedule.
    My problem is that each mdi form is pointing to the original data table.
    any input will be appreciated.
    Code:
    Private Sub LoadNewDoc()
        'table2 is a template table. each child form should point
        'to a new table with a name=to the caption of the child form
        Dim frmD As frmDocument
        Dim StrTemp As String 'name of panel
        Set frmD = New frmDocument 'create a child form based on the model
        StrTemp = InputBox("enter Panel Name", "Panel Name?") 'Get name for this panel
        frmD.Caption = StrTemp 'set child window caption to the panel name
        Call CopyTable("c:\test\db1.mdb", "table2", StrTemp) 'copy table 2 to the name of the panel
        frmD.Data1.RecordSource = StrTemp 'try to get the new mdi form to point to the new table
        frmD.Show 'show the user what they've won!
    End Sub
    how can I get this to work if the panel name has a space in it?
    thank you for your time and have a good day
    I am so skeptical, I can hardly believe it!
    PS I am not a 'hyperactive member' I am a cool, calm, and collected member

  2. #2
    Member
    Join Date
    May 2000
    Posts
    45
    If I read what you've got right, you're trying to get at a table with a space in it's name?

    To do this, you need to wrap a [ and a ] around the table names. This works for SQL Server 7, I'm not sure about access or SQL 6.5
    K

    ----------------------------------
    VB6 Ent SP4 Win2K Pro Platform SDK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width