I'm creating Address book.
Header of the main form (frmAddress) contains combo box (cboFilter) to
filter records by Occupation on main Form(Ocupation1). That's working. Combo
box also have "Show All" in one row.
==Combo box query:
SELECT tblOCUPATION.id, tblOCUPATION.txtOcupation1 FROM tblOCUPATION UNION
Select "(All)" as Bogus, Null as AllChoice From [tblOCUPATION];
==Combo box event:
If IsNull(Me![cboFilter]) Then
DoCmd.ShowAllRecords
Else
DoCmd.ApplyFilter , "[Ocupation1] = '" & Me!cboFilter & "'"
End If
Forms!frmAddress!LstBoxSearch.Requery
That's working.
Here is the Problem.
I have text box on main form to show all records or filtered ones, and to
pick a name from it (it must be the same as records on main form!).
When i pick Ocupation in cboFilter Text box is filtered, Form filtered but
when i select Ocupation in cboFilter=Null (=Show All Records) it dosent show
enything in text box ?! (Note: records on main Form working and showing all
records)?!
==List box query:
SELECT qrySearch.id, qrySearch.Name, qrySearch.Ocupation1 FROM
qrySearchWHERE qrySearch.Ocupation Like Forms!frmAddress.cboFilter ORDER BY
qrySearch.Name;
==List box event:
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[RedniBroj] = " & Str(Nz(Me![LstBoxPretrazivanje], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I think that problem is in List box query? maybe something like "...UNION
show all records"... but i tried many ways, search the web and that didnt
worked for me.
Thanks for help
(sorry for bad english)