Public Function test_proc(my_jobno As String)
Dim comm As New ADODB.Command
Dim para As New ADODB.Parameter
With comm
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "usp_qry_production_cn"
End With
Set para = comm.CreateParameter(, adVarChar, adparainput, 10, mj_jobno)
comm.Parameters.Append para
If Not IsNull(my_jobno) Then
comm.Execute '現在用傳統的方法調用成功,但問題是我怎樣把數據賦給一個表格哪?
Else
MsgBox "請輸入一個JOBNO號碼", vbOKOnly, "err_info"
End If
Set para = Nothing
Set comm = Nothing
End Function
這是傳統的調用方法,但現在我怎麼才能實現實似於docmd.runsql哪樣的出現查詢數據窗體的效果哪?
正如KenjiSato所想的想的一樣,我也像好哪樣思考過,但從沒成功過,
現在參考了kenjisato的方法,可能是太笨,還是失敗了。
請kenjisato和高手們再指點。多謝!