设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: youchytan
打印 上一主题 下一主题

[模块/函数] 求助:代码错在什么地方?

[复制链接]
11#
 楼主| 发表于 2009-5-7 14:14:46 | 只看该作者
我传了个03版的.那位给看看
12#
 楼主| 发表于 2009-5-7 14:28:22 | 只看该作者
在保存按钮中有相关代码
13#
发表于 2009-5-7 14:39:55 | 只看该作者
估计是这句有问题了:strSQL = "select * from tblCureStep where Type ='" & Trim(txtID) & "'"
应该是下面的样子:
strSQL = "select * from tblCureStep where id ='" & Trim(txtID) & "'"
14#
 楼主| 发表于 2009-5-7 15:57:29 | 只看该作者
谢谢.估计是它了
15#
 楼主| 发表于 2009-5-7 16:16:30 | 只看该作者
是它.我糊了.再次谢谢.
16#
发表于 2009-5-7 16:46:46 | 只看该作者
Private Sub cmdOK_Click()
    Dim strSQL As String
    Dim rst As ADODB.Recordset
    If IsNull(txtCureStep) Then
        MsgBox "治疗步骤没有填写!"
        txtCureStep.SetFocus
        Exit Sub
    End If
    If IsNull(cboType) Then
        MsgBox "类别必须选择!"
        cboType.SetFocus
        Exit Sub
    End If
    strSQL = "select * from tblCureStep where Type ='" & Trim(txtID) & "'"
    Set rst = New ADODB.Recordset
    rst.Open strSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
    With rst
        If Not .EOF Then
            ![CureStep] = txtCureStep
            ![Type] = cboType
            .Update
        End If
    End With
    rst.Close
    Set rst = Nothing
    '   Forms("frmCureStep")!subCureStep.Form.Requery
    DoCmd.Close acForm, Me.Name
End Sub

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-4 01:38 , Processed in 0.106849 second(s), 28 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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