设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 982|回复: 2
打印 上一主题 下一主题

[模块/函数] 请教:老是提示错误“424”,要求对像,是么回事,谢谢了!

[复制链接]
跳转到指定楼层
1#
发表于 2008-1-26 14:42:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我的代码如下:
在模块中,定义了一个属性:
Type qimocondition
  distribute_type As String
  distribute_order As Integer
End Type
Type qimoconditions
   count As Integer
   items(50) As qimocondition
End Type
Dim qimoconds As qimoconditions

在一个按钮的CLICK事件中引用如下:
'点击确认按钮命令执行的程序
Private Sub cmd_qimo_generate_Click()
Dim txtnew_qimo As String
'On Error GoTo Err_cmd_qimo_generate_Click
If IsNull(Combo67.Value) Then
  MsgBox "在选择期末数据匹配前,请选择所属期间!", vbOKOnly + vbExclamation, "系统提示"
  Combo107.SetFocus
  Exit Sub
End If
If IsNull(Combo75.Value) Then
  MsgBox "在选择期末数据匹配前,请选择待匹配类型!", vbOKOnly + vbExclamation, "系统提示"
  Combo75.SetFocus
  Exit Sub
End If
txtnew_qimo = Combo75.Column(0)
For i = 0 To qimoconds.count
   If txtnew_qimo = qimoconds.items(i).distribute_type Then
      MsgBox "所选择的分配类型与前面的重复,请重新选择!", vbOKOnly + vbExclamation, "系统提示"
      Combo75.SetFocus
      Exit Sub
   End If
Next i
With qimoconds.items(qimoconds.count)
   .distribute_type = Combo75.Column(0)
   .distribute_order = qimoconds.count
End With
     
qimoconds.count = qimoconds.count + 1
     
显示期末匹配顺序设置
     
Exit_cmd_qimo_generate_Click:
    Exit Sub
Err_cmd_qimo_generate_Click:
    MsgBox Err.Description
    Resume Exit_cmd_qimo_generate_Click
End Sub


Private Sub 显示期末匹配顺序设置()
Dim j As Integer
  List73.RowSource = "期末分配类型;分配次序;"
  For j = 0 To qimoconds.count - 1
    With qimoconds.items(j)
      List73.RowSource = List73.RowSource & .distribute_type & ";" & .distribute_order & ";"
    End With
  Next j
End Sub
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2008-1-26 14:49:22 | 只看该作者
摸索了半天,原来没有在窗体过程中没有定义,哈哈
得来全费工夫,呵呵!

点击这里给我发消息

3#
发表于 2008-1-27 01:28:15 | 只看该作者
自己解决的问题会记得更加牢固
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-6-1 13:54 , Processed in 0.082602 second(s), 26 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表