Have to say first of all folks that only been on here for a day or 2 and the info that can be found is invaluble to an inexperienced newbie to Access such as myself !!!
The particular problem I'm trying to over-come at the moment is that of an SQL Statement used to populate a list box within a form, I am trying to make it possible so that a that a user can open a second form from with fields auto-filled etc...
Now for the crux...
On the first form (frmDealers1) the user enters either a UniqueID (DID#) or Dealer Name (Client) into an unbound txt Box that applies a filter to my list box or the user can simply scroll thourgh the List Box, problem here is twofold really
I can type in a Dealers Name and the Filter works fine, but there is 3800 Dealer Names within the total list...and some of the names are not unique!
Secondly I am unable to use the DID# to locate the Dealers, i.e i cannot use the DID# to look up records?
Below is a copy of the SQL Statement I have used:
SELECT Dealers.Client, Dealers.dealerID FROM Dealers WHERE (((Dealers.dealerID) Like Forms!frmDealers!txtSearchBox & "*")) Or (((Dealers.Client) Like Forms!frmDealers!txtSearchBox & "*"));
The List Box only displays Dealer Names and not DID# aswell, however if I change the positions of the fields in the SQL Statement Builder (1st is Dealers 2nd is DID#...if these are swapped) then only the DID# is displayed and the txt Box will only except a search by DID#.............
Have tried replacing the "OR" with "AND" in the syntax but with no success!!
Maybe had better include the code for the opening of my second form aswell to elaborate more...
Private Sub lstDealers_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmDealers1", acNormal, , "client = '" & Me.lstDealers & "'"
This probably is a confusing way of trying to explain things on my side, but if anyone is able to understand this, then any help offered is MOST gratefully received !!!
The particular problem I'm trying to over-come at the moment is that of an SQL Statement used to populate a list box within a form, I am trying to make it possible so that a that a user can open a second form from with fields auto-filled etc...
Now for the crux...
On the first form (frmDealers1) the user enters either a UniqueID (DID#) or Dealer Name (Client) into an unbound txt Box that applies a filter to my list box or the user can simply scroll thourgh the List Box, problem here is twofold really

I can type in a Dealers Name and the Filter works fine, but there is 3800 Dealer Names within the total list...and some of the names are not unique!
Secondly I am unable to use the DID# to locate the Dealers, i.e i cannot use the DID# to look up records?
Below is a copy of the SQL Statement I have used:
SELECT Dealers.Client, Dealers.dealerID FROM Dealers WHERE (((Dealers.dealerID) Like Forms!frmDealers!txtSearchBox & "*")) Or (((Dealers.Client) Like Forms!frmDealers!txtSearchBox & "*"));
The List Box only displays Dealer Names and not DID# aswell, however if I change the positions of the fields in the SQL Statement Builder (1st is Dealers 2nd is DID#...if these are swapped) then only the DID# is displayed and the txt Box will only except a search by DID#.............

Have tried replacing the "OR" with "AND" in the syntax but with no success!!
Maybe had better include the code for the opening of my second form aswell to elaborate more...
Private Sub lstDealers_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmDealers1", acNormal, , "client = '" & Me.lstDealers & "'"
This probably is a confusing way of trying to explain things on my side, but if anyone is able to understand this, then any help offered is MOST gratefully received !!!