Welcome Guest.

1Answers

WHERE ID=" & ID, , 4 是什么意思?

Asked by: Edward Patel 231 views IT August 14, 2018

On Error GoTo ErrorHandler

    Dim strTemplate As String

    Dim strFileName As String

    Dim objApp As Object    'New Word.Application

    Dim objDoc As Object    'Word.Document

    Dim objField As Object    'Word.Field

    Dim rst As Object

    Dim blnNoQuit As Boolean

    strTemplate = CurrentProject.Path &"\模板\通知单模板.doc" 

   '设置鼠标指针为沙漏形状

    DoCmd.Hourglass True

    Set objApp = CreateObject("Word.Application")

    Set objDoc = objApp.Documents.Open(strTemplate)

    Set rst = CurrentDb.OpenRecordset("SELECT * FROM tbl通知单 WHERE ID=" &ID, , 4)

    If Not rst.EOF Then

1 Answers

  1. +7Votes  

    This is a string connector, indicating that the ID is a variable, such as ID=1234

    then the SQL is

    SELECT * FROM tblNotice WHERE ID=1234

    and 4 of them open the recordset as read-only.

    Hughes- August 14, 2018 |