Office中国论坛/Access中国论坛

标题: 引用出现的难题如何解决? [打印本页]

作者: 付谦    时间: 2007-2-6 21:41
标题: 引用出现的难题如何解决?
附件中有2个窗体,都引用了ACTIVEX DATA OBJATS2。1,只能打开其中的一个窗体,将引用的位置改变,原不能打开的窗体可以打开,原能打开的窗体反而出错。此问题如何解决?另外请教如何打印列表框数据,怎窗体中的报表打不开?请高手好事做到底[attach]22994[/attach]

作者: qlm    时间: 2007-2-7 02:40
我没仔细看你的程序,不过编译中发现错误,后改成下面这样,就没事了

(1)

Option Compare Database
Option Explicit
Dim rst5 As New ADODB.Recordset
Dim lstSource As String

(2)

Private Sub FillOptions()
' Fill in the options for this switchboard page.

    ' The number of buttons on the form.
   
    Dim dbs As Database
    Dim rst As DAO.Recordset
   
    Dim strsql As String
    Dim intOption As Integer
作者: qlm    时间: 2007-2-7 02:48
If lstPrint.ListCount > 0 Then
    For temp = 0 To (lstPrint.ListCount - 1)
   result = result & " (员工流动.姓名 = '" & lstPrint.ItemData(temp) & "') OR"
  Next temp
   
    DoCmd.OpenReport "调动介绍信", acViewPreview, , , , Left(result, Len(result) - 3)
Else
    MsgBox "没有选择打印对象", vbExclamation, "提示"



                           看对不对!

[此贴子已经被作者于2007-2-6 18:48:54编辑过]


作者: 付谦    时间: 2007-2-7 03:17
2楼3楼真是高手,佩服!一下子解决了我想了几天的难题,谢谢!
作者: qlm    时间: 2007-2-7 03:30
以下是引用付谦在2007-2-6 19:17:00的发言:


2楼3楼真是高手,佩服!一下子解决了我想了几天的难题,谢谢!



过奖了!

当代码出现问题, 在VBA编辑器调试菜单里选 编译....

就能发现问题




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3