Re: Combo Boxes Containing "*"
- From: "Baz" <bazz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 3 Aug 2007 07:29:56 +0100
If you suspect that Access is somehow choking on the * character (and that
seems as good a hypothesis as any) could you maybe try replacing it with
some other character? For instance, you could see what happens if you use
this as the rowsource:
"SELECT TOP 100 PERCENT EquipmentID, Replace(PieceNr,"*","#") AS
ChangePieceNr FROM Table_Equipment ORDER BY PieceNr"
A bit of a pain for your users (if it works at all) since I suppose they are
accustomed to the *, but they would soon get used to it.
"Anthony Headley" <hoss@xxxxxxxxxxxxxxxxx> wrote in message
news:op.twfq8mix54t6ci@xxxxxxxxxxxxxxxxxx
Morning/Afternoon Evening all,
I have an odd issue that maybe someone here could help me out with. Please
excuse if this is in the wrong group.
So, I have an ADP connected to a SQLExpress Server and performance is
quite good but I am having some issues selecting some Items from Combo
Boxes.
My issue is as follows:
I have a combo box that is part of a subform that has it?s rowsource =
"SELECT TOP 100 PERCENT EquipmentID, PieceNr FROM Table_Equipment ORDER BY
PieceNr"
This returnes about 1000 items that look about like this:
35 LY*101CA
35 LY*101DV
1 ML*101AM
2 ML*101DV
344 ML*101XX
....
The combo box is correctly configured to bind to the first column and show
only the second, and it box works great as long as I select the item from
the dropdown list (F4) or use the mouse. However, as soon as I paste, or
type, a value that I know is in the list the NotInList event fires; even
though I can select the item from the dropdown box.
I have even tried creating a progressive an OnKeyPress Query to narrow
down the choices in case 1000 items was too much, but even after the list
is narrowed down to 1 item it still fires the NotInList Event if I press
{Arrow Down}, {Arrow Left}, {Tab}, or {Enter}.
So then, as a work around I created this event:
~snip~
Private Sub Piece_Nr_NotInList(NewData As String, Response As Integer)
Me.Piece_Nr.RowSource = "SELECT EquipmentID, PieceNr FROM
Table_Equipment WHERE PieceNr = '" & NewData & "'"
If Me.Piece_Nr.ListCount > 0 Then
Me.Piece_Nr.ListIndex = 0 ?this seems to be the only way to have
the item selected
Response = acDataErrAdded ?this does not seem to requery the
control as stated in help.
Else
Response = acDataErrDisplay
End If
End Sub
~snip~
This works, kind of but leaves me with the dropdown extended and I have to
press enter twice before the value is taken.
Personally I think it because the values that I?m looking up contains a
?*?. It seems that as soon as I type the ?*? the Auto Expand function
stops expanding and the list is reset back to the beginning. I also also
tried looking other values like ?Test?, ?This?, ?DxxxxWork!? and they are
all ok type typing and pasting.
This is the first time I am experiencing this issue since this database
was at one time in its life a MDB. Also I have already tried LIKE %
queries but that did not help my workaround.
Any ideas would be super useful.
Thanks , And sorry again if this is the wrong group.
Anthony
.
- Follow-Ups:
- Re: Combo Boxes Containing "*"
- From: Anthony Headley
- Re: Combo Boxes Containing "*"
- References:
- Combo Boxes Containing "*"
- From: Anthony Headley
- Combo Boxes Containing "*"
- Prev by Date: SQL 2005 Express Table Relationships
- Next by Date: Re: Combo Boxes Containing "*"
- Previous by thread: Combo Boxes Containing "*"
- Next by thread: Re: Combo Boxes Containing "*"
- Index(es):
Relevant Pages
|