Filter blanks screen

S

SAC

When I apply a filter the whole screen goes blank...no controls show...

I'm using a combo box and in the after update event I have:
Me.Filter = "Country = 'USA'"
Me.FilterOn = True

Any ideas?

Thanks
 
J

John Vinson

When I apply a filter the whole screen goes blank...no controls show...

I'm using a combo box and in the after update event I have:
Me.Filter = "Country = 'USA'"
Me.FilterOn = True

Any ideas?

Thanks

It sounds like a) there are no records in the table with 'USA' in the
Country field (maybe the Country is blank for USA addresses and only
entered for foreign ones), so no existing records show; and b) the
Form's recordset is not updateable, or the Form does not allow data
entry, so you don't see the new record either.

John W. Vinson[MVP]
 
S

SAC

The recordset is not updateable. This recordset cannot be updateable, so
any ideas on what to do?

I was thinking about setting the query criteria to the control on the form,
but I need four different dropdown boxes to allow finding records by
different fields:

Cust PO
Our Oder NO
Item NO
BOL NO

Any ideas on how to do this?

Thanks for your help.
 
J

John Vinson

The recordset is not updateable. This recordset cannot be updateable, so
any ideas on what to do?

I was thinking about setting the query criteria to the control on the form,
but I need four different dropdown boxes to allow finding records by
different fields:

Cust PO
Our Oder NO
Item NO
BOL NO

What you might want to do is to first use DLookUp or a recordset to
check, and only open the form if there are records. For example:

Dim strCrit As String
strCrit = "TRUE"
If Not IsNull(Me![Cust PO] Then
strCrit = strCrit & " AND [Cust PO] = " & Me![Cust PO]
End If
If Not IsNull(Me![Our Oder No] Then ' sic - should be Order?
strCrit = strCrit & " AND [Our Oder No] = " & Me![Our Oder No]
End If
If Not IsNull(Me![Item NO] Then
strCrit = strCrit & " AND [Cust PO] = " & Me![Item NO]
End If
If Not IsNull(Me![BOL NO] Then
strCrit = strCrit & " AND [BOL NO] = " & Me![BOL NO]
End If
If IsNull(DLookUp("[Cust PO]", "yourtable", strCrit) Then
MsgBox "No orders found", vbOKOnly
Else
Me.Filter = strCrit
End If


John W. Vinson[MVP]
 
Top