A
Aleks
Some body help, please.
After this command (DoCmd.OpenForm
FormName:="frmRecepturyProd", WhereCondition:=gstrWhereID)
appear error '2501' with:'action openform was canceled'.
It's look like Access could't apply filter.
I try def. filter and use method:
OpenForm "frm....","","Filter","",....., but
Some times appear error, that Access could't find
form 'frm...'.
Whole code VB is:
Private Sub cmdSome_Click()
Dim strWhere As String, varItem As Variant
If Me!lstBName.ItemsSelected.Count = 0 Then Exit Sub
For Each varItem In Me!lstBName.ItemsSelected
strWhere = strWhere & Chr$(34) & Me!lstBName.Column(0,
varItem) & Chr$(34) & ","
Next varItem
strWhere = Left$(strWhere, Len(strWhere) - 1)
gstrWhereID = "[IDReceptury] IN (" & strWhere & ")"
DoCmd.OpenForm FormName:="frmRecepturyProd",
WhereCondition:=gstrWhereID
DoCmd.Close acForm, Me.Name
End Sub
P.S lstBName - list box
After this command (DoCmd.OpenForm
FormName:="frmRecepturyProd", WhereCondition:=gstrWhereID)
appear error '2501' with:'action openform was canceled'.
It's look like Access could't apply filter.
I try def. filter and use method:
OpenForm "frm....","","Filter","",....., but
Some times appear error, that Access could't find
form 'frm...'.
Whole code VB is:
Private Sub cmdSome_Click()
Dim strWhere As String, varItem As Variant
If Me!lstBName.ItemsSelected.Count = 0 Then Exit Sub
For Each varItem In Me!lstBName.ItemsSelected
strWhere = strWhere & Chr$(34) & Me!lstBName.Column(0,
varItem) & Chr$(34) & ","
Next varItem
strWhere = Left$(strWhere, Len(strWhere) - 1)
gstrWhereID = "[IDReceptury] IN (" & strWhere & ")"
DoCmd.OpenForm FormName:="frmRecepturyProd",
WhereCondition:=gstrWhereID
DoCmd.Close acForm, Me.Name
End Sub
P.S lstBName - list box