我最近在学VB中的报表控件,下了个实例,可是运行时总显示找不到方法和数据。小弟初学,请高手指导下小弟。 登陆窗体部分代码如下 Private Sub cmdCancel_Click() Unload Me End Sub
Private Sub cmdLogin_Click() DSN = txtDB.Text UID = txtUserName.Text PWD = txtPassword.Text ConnectID = "DSN=" & DSN & ";UID=" & UID & ";PWD=" _ & PWD & ";DATABASE=Test;"
With frmMain !mnuTrade.Enabled = True !mnuStatistics.Enabled = True !mnuReport.Enabled = True !mnuDataManager.Enabled = True End With Unload Me End Sub 报表页面部分代码 Private Sub SetRPT() '显示报表 rpt1.Destination = crptToWindow rpt1.Action = 1 End Sub Private Sub MDIForm_Load() Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000) Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000) Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500) Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500) mnuTrade.Enabled = False mnuStatistics.Enabled = False mnuReport.Enabled = False mnuDataManager.Enabled = False Me.Show Login rpt1.Connect = ConnectID rpt1.ReportFileName = App.Path & "\SQLTest.rpt" '报表文件 End Sub
[此贴子已经被作者于2005-6-2 13:58:36编辑过]