childrenfirst
Technical User
Hi,
I have a form which has two controls, txtViewReportNum and txtViewDescription, and a subform which shows results from a SQL stored procedure named s_ViewList. The problem with my vba code is that the string which execute and return values from the stored procedure always seems to execute before values are loaded into the two controls. However, the stored procedure is supposed to run AFTER values are loaded into the two controls, and the value in txtViewReportNum will be passed to the stored procedure as a parameter.
How do I stop the code below from being executed until values are loaded into txtViewList, and make sure that value in txtViewReportNum will be passed to the string below?
-----current string which execute the stored procedure---
'update subfPreviewNewList
Dim strReportNum As String
Dim strList As String
'update frmAuditList with the information for the selected list/report
strReportNum = Me.txtViewReportNum.Value
MsgBox strReportNum
strList = "EXEC s_ViewList '" & strReportNum & "'"
Me!subfPreviewNewList.Form.RecordSource = strList
----------------------------------------------------
Any advice will be greatly appreciated!!!
Happy holiday
I have a form which has two controls, txtViewReportNum and txtViewDescription, and a subform which shows results from a SQL stored procedure named s_ViewList. The problem with my vba code is that the string which execute and return values from the stored procedure always seems to execute before values are loaded into the two controls. However, the stored procedure is supposed to run AFTER values are loaded into the two controls, and the value in txtViewReportNum will be passed to the stored procedure as a parameter.
How do I stop the code below from being executed until values are loaded into txtViewList, and make sure that value in txtViewReportNum will be passed to the string below?
-----current string which execute the stored procedure---
'update subfPreviewNewList
Dim strReportNum As String
Dim strList As String
'update frmAuditList with the information for the selected list/report
strReportNum = Me.txtViewReportNum.Value
MsgBox strReportNum
strList = "EXEC s_ViewList '" & strReportNum & "'"
Me!subfPreviewNewList.Form.RecordSource = strList
----------------------------------------------------
Any advice will be greatly appreciated!!!
Happy holiday