K
Ken Hudson
I got some assistance here yesterday with passing one argument to a form.
Like most cases, you always wnat one more thing.
In addition to passing a hard coded argument, I want to pass a variable
argument.
I have used an InputBox to capture the variable.
How do I then pass the hard coded and varibale arguments to the form?
Private Sub cmdOpenActiveProjectsForm_Click()
On Error GoTo Err_cmdOpenActiveProjectsForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stEmpNumber
stEmpNumber = InputBox("Enter your employee number.")
stLinkCriteria = "intStatus = 1," & stEmpNumber (This does not work.)
stDocName = "frmProjectsPM"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenActiveProjectsForm_Click:
Exit Sub
Err_cmdOpenActiveProjectsForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenActiveProjectsForm_Click
End Sub
Like most cases, you always wnat one more thing.
In addition to passing a hard coded argument, I want to pass a variable
argument.
I have used an InputBox to capture the variable.
How do I then pass the hard coded and varibale arguments to the form?
Private Sub cmdOpenActiveProjectsForm_Click()
On Error GoTo Err_cmdOpenActiveProjectsForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stEmpNumber
stEmpNumber = InputBox("Enter your employee number.")
stLinkCriteria = "intStatus = 1," & stEmpNumber (This does not work.)
stDocName = "frmProjectsPM"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenActiveProjectsForm_Click:
Exit Sub
Err_cmdOpenActiveProjectsForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenActiveProjectsForm_Click
End Sub