Strange



Hi. I have a Form that looks up Customer information via a number of Combo
Boxes. The Text Boxes are Bound to the Customers Table and the "find" combo
Boxes arte unbound. I use the following External Function to locate the
record and set the bookmark to the record so the Text boxes show the
information held in the record. I then place the apropriate info into the
various "Find" Combo Boxes. I do this with the following code

Public Function util_ShowInfo(frm As Form, strField As String, varInfo As
Variant) As Boolean

If IsNumeric(varInfo) Then
strCriteria = BuildCriteria(strField, dbInteger, varInfo)
Else
strCriteria = BuildCriteria(strField, dbText, varInfo)
End If

With frm.RecordsetClone
.FindFirst strCriteria
If Not .NoMatch Then
frm.Bookmark = .Bookmark
frm!cmbFindStoreNo = .StoreNo ' cmbFindStoreNo
frm!cmbFindStoreName = .StoreName ' cmbFindStoreName
frm!cmbFindAccNo = .AccountNo ' cmbFindAccountNo
frm!cmbFindCustomerName = .CustomerName ' cmbFindCustomerName
frm!cmbContractNo = .ContractNo
util_ShowInfo = True
Else
util_ShowInfo = False
End If

End With

End Function

This all works fine EXCEPT when I look up a customer called "All Sorts" in
this instance I get the following error :- Run -time Error '7956' The syntax
of the sub queryin this expression is incorrect.
This is generated by the following line in the above code :-
strCriteria = BuildCriteria(strField, dbText, varInfo)
I can search for a customer called "Allied Dunbar! and find it wth no
problem as I can with othe customers in the table but when I search for "All
Sorts" I always get this Error.
Even stranger, if I change the information in the Field to "A", it finds the
record with no problem. Change the information in the Field to "Al" it finds
the record with no problem. Change the information in the Field to "All" and
I get an Error but it is slightly different from the one above :- Run-time
Error '2431' The Expression you entered contains invalid syntax. Change the
information in the Field back to "All Sorts" and I am back to the Message -
Run -time Error '7956' The syntax of the sub query in this expression is
incorrect .

Does anyone know what could be happening?

Thanks RayC




.



Relevant Pages

  • Re: display results from combo/ narrow list as typed
    ... How many columns are you showing in the property for the combobox? ... I have 2 combo boxes on my customer maintenance form. ... typing in a part # starting w/ P, then I want the box to show ONLY those ...
    (microsoft.public.access.formscoding)
  • RE: Search facility query
    ... I have put the three boxes on the main form. ... The name of the control on the main form for customer name ... The name of the table or query that is the record source for the main form. ... Set rstClone = Me.RecordsetClone ...
    (microsoft.public.access.modulesdaovba)
  • display results from combo/ narrow list as typed
    ... I have 2 combo boxes on my customer maintenance form. ... the shipping locations for that customer. ...
    (microsoft.public.access.formscoding)
  • Re: How to input different data in combo / check boxes for datashe
    ... You state "I now want to record what products each customer buys and whether ... If you want to store products each customer buys, ... Are you check boxes bound to a field in a table/ ... >> Duane Hookom ...
    (microsoft.public.access.gettingstarted)
  • Re: Strange
    ... The Text Boxes are Bound to the Customers Table and the "find" combo Boxes arte unbound. ... Public Function util_ShowInfo(frm As Form, strField As String, varInfo As Variant) As Boolean ... strCriteria = BuildCriteria ...
    (microsoft.public.access.gettingstarted)

Loading