DoCmd.OpenForm "frmFilters", acNormal, , , , acDialog
If IsFormLoaded("frmFilters") Then '-- если да, то построить строку параметров
Set f = Forms("frmFilters")
' Set rs = Forms("frmFilters").RecordsetClone
' pparam = ""
' If Not rs.EOF Then
' rs.MoveLast: rs.MoveFirst
' Do While Not rs.EOF
' If Nz(rs.Fields("invno").value, 0) > 0 Then pparam = pparam & "," & rs.Fields("invno").value
' rs.MoveNext
' Loop
' End If
' pparam = Mid(pparam, 2)
If DCount("[invno]", "_filter_invno") > 0 Then
pparam = "select invno from [_filter_invno]"
mw = IIf(mw <> "", mw & " and nz(invno,0) in (" & pparam & ")", "WHERE nz(invno,0) in (" & pparam & ")")
Me.capInvno.ForeColor = 16711680
Else
MsgBox "В форме 'Фильтр' не найдено ни одного инвентарного номера!"
End If
If f.isOk <> 0 Then DoCmd.Close acForm, f.Name
End If
|