I am trying to figure some stuff out.
I have a frmDocument that is the model for all the mdi children.(used the VB wizard and took all the defaults)
I have modified the wizard sub for creating the new mdi child form.
frmDocument has a data control and a DBgrid on it.
when the user clicks to create a new mdi child form I want the flowing to happen.
make a new table in access with a user input name
make the caption of the new form=to the above user input
get the data control on the new form to point to/at the new access table
show the new form.
Each form is intended to represent an electric power panel.
The database will have one table per panel. There will be other tables in the database(maybe)
here is the code:
as noted the error I get isCode: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.DBGrid1.DataSource = frmD.Data1 'get the grid to point to the data control ***gives error*** frmD.Show 'show the user what they've won! End Sub
#430
Class does not support Automation or does not support expected interface
I have referenced the following
VB for apps
VB runtime objects and procedures
VB objects and procedures
OLE automation
MS DAO 2.5/3.5 Compatibility Library
I am using VB6 W/SP3
thank you for your time and have a good day





Reply With Quote