My Assistant
![]() ![]() |
|
|
Apr 6 2012, 09:01 AM
Post
#1
|
|
|
UtterAccess Member Posts: 37 |
Hi All
Something is going wrong . I have a mainform where i build in some filter options (one with set option group , and one build on a combo box) Now the combobox filter give me a problem, it does not filter to the records with customerID = cmdcustomer (combobox) Private Sub cmdcustomer_AfterUpdate() Dim intNumOfDetails As Integer Dim strMsg As String 'Will the Filter (Order ID/Section) actually produce any Records?) intNumOfDetails = DCount("*", "frmEntwicklungsanfrageUbersicht", "[CustomerID] = " & Me![cmdcustomer]) If Not IsNull(Me![cmdcustomer]) Then 'must be an entry If intNumOfDetails > 0 Then 'Filter produces Records Me![frmEntwicklungsanfrageUbersicht].Form.Filter = "[CustomerID] = " & Me![cmdcustomer] Me![frmEntwicklungsanfrageUbersicht].Form.FilterOn = True Else strMsg = "Keine EntwicklugsAnfragen fur customerID [Me![cmdcustomer]]" MsgBox strMsg, vbExclamation, "Keine Entwicklungs Anfragen" End If End If End Sub Someone a clue Dummy This post has been edited by dummy2: Apr 6 2012, 09:02 AM |
|
|
|
Apr 6 2012, 09:09 AM
Post
#2
|
|
|
UtterAccess Ruler Posts: 1,090 |
will this work:
Private Sub cmdcustomer_AfterUpdate() Dim intNumOfDetails As Integer Dim strMsg As String 'Will the Filter (Order ID/Section) actually produce any Records?) intNumOfDetails = DCount("*", "frmEntwicklungsanfrageUbersicht", "[CustomerID] = " & Me!cmdcustomer.Column(0)) If Not IsNull(Me![cmdcustomer]) Then 'must be an entry If intNumOfDetails > 0 Then 'Filter produces Records intNumOfDetails = DCount("*", "frmEntwicklungsanfrageUbersicht", "[CustomerID] = " & Me!cmdcustomer.Column(0)) If Not IsNull(Me![cmdcustomer]) Then 'must be an entry If intNumOfDetails > 0 Then 'Filter produces Records Me![frmEntwicklungsanfrageUbersicht].Form.Filter = "[CustomerID] = " & Me!cmdcustomer.Column(0) Me![frmEntwicklungsanfrageUbersicht].Form.FilterOn = True Else strMsg = "Keine EntwicklugsAnfragen fur customerID [Me![cmdcustomer]]" MsgBox strMsg, vbExclamation, "Keine Entwicklungs Anfragen" End If End If End Sub |
|
|
|
Apr 6 2012, 09:16 AM
Post
#3
|
|
|
UtterAccess Member Posts: 37 |
Hi Arnelgp
No did not work eather. Dummy |
|
|
|
Apr 6 2012, 09:45 AM
Post
#4
|
|
|
UtterAccess Member Posts: 37 |
Hi all Maybe it has to do that the main form is a unbound form with the subform. The mainform is like a switchboard. mainform = frmEntwicklung Greats Dummy |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 02:15 AM |