potts
Registered User.
- Local time
- Today, 18:09
- Joined
- Jul 24, 2002
- Messages
- 87
I posted this question on one of the other forums, but haven't had much luck - was wondering if anyone here had any ideas.
I have build a form containing a multi-select list box and a command button. Attached to the on click event of the command button is the following code:
Dim strWhere As String, varItem As Varient
If Me.lstProcedures.ItemsSelected.Count = 0 Then
Exit Sub
End If
For Each varItem In Me.lstProcedures.ItemsSelected
strWhere = strWhere & Chr$ (34) & Me.lstProcedures.Column(0, varItem) & Chr$ (34) & ","
Next varItem
strWhere = Left$ (strWhere, Len(strWhere) - 1)
gstrWhereProcedure = "[ProcedureID] In (" & strWhere & ")"
Do.Cmd.OpenForm FormName:="frmInputProcedures", WhereCondition:=gstrWhereProcedure
End Sub
the form to be opened is called frmInputProcedures
the list box is called lstProcedures
the bound column of the listbox query is the first column and contains the ProcedureID that identifies the fields in frmInputProcedures.
the frmInputProcedures form is a tabular form
My problem is that when the command button is clicked, a form appears asking me to enter a parameter value for the ProcedureID - I don't want this to happen.
does anyone know how I might fix this problem? Or does any one have a better system for filtering values in one form based on the values filtered in a list box on another form?
I have build a form containing a multi-select list box and a command button. Attached to the on click event of the command button is the following code:
Dim strWhere As String, varItem As Varient
If Me.lstProcedures.ItemsSelected.Count = 0 Then
Exit Sub
End If
For Each varItem In Me.lstProcedures.ItemsSelected
strWhere = strWhere & Chr$ (34) & Me.lstProcedures.Column(0, varItem) & Chr$ (34) & ","
Next varItem
strWhere = Left$ (strWhere, Len(strWhere) - 1)
gstrWhereProcedure = "[ProcedureID] In (" & strWhere & ")"
Do.Cmd.OpenForm FormName:="frmInputProcedures", WhereCondition:=gstrWhereProcedure
End Sub
the form to be opened is called frmInputProcedures
the list box is called lstProcedures
the bound column of the listbox query is the first column and contains the ProcedureID that identifies the fields in frmInputProcedures.
the frmInputProcedures form is a tabular form
My problem is that when the command button is clicked, a form appears asking me to enter a parameter value for the ProcedureID - I don't want this to happen.
does anyone know how I might fix this problem? Or does any one have a better system for filtering values in one form based on the values filtered in a list box on another form?