Connecting Tech Pros Worldwide Forums | Help | Site Map

Ignoring spaces in combobox text: done,almost!

Thelma Lubkin
Guest
 
Posts: n/a
#1: Nov 13 '05
Arno R <arraNOcomSPAM@tiscali.nl> wrote:
:> user types Mary Jane Jones
:> database has MaryJane Jones

: I finally understand why you need to 'despace' the field in the
: Lookuptable also.
: First idea that comes to my mind now is that I would create the
: 'despaced' values in the LookupQuery:
: Database has:
: MaryJane Jones
: JoAnne Cook

: LookupQuery has: (use the 'despace function' here)
: MaryJaneJones
: JoAnneCook

: This way the validation would be a simple Lookup again where you
: only need to 'despace' the user-input.


Thanks to you and to rkc, I have now got this *almost*
working. I've been able to do the 'despaced' comparison
of user's text with the bound column of the combobox's
rows, using rkc's loop on the rows [rows and columns begin
at 0]. The field I need to retrieve is another column in the
combobox.

I think that the remaining problem may not be easy to track
down without a hands-on attack, but here goes:

My combo-box, which displays one of its 2 columns,
never displays the first row of the table [text-sorted,
ascending on bound column of the combo-box].

I put a MsgBox into the loop to display the combo-box's bound
column for each row: for the 0th row it displays
the missing 0'th table row text as the current [0th-combo-box
row] text, and it displays the first visible bound column in
the combo-box as the message-box title, [I don't provide a
title for the message-box--it usually defaults] with the entire
box strangely elongated.
After that the MsgBox displays as I would expect
from looking at the *visible* combo-box content. Bottom line:
the first [sorted] row of the table can't be accessed from
the combo-box.

Two unrelated things I ran into while working on this:

The spy-helper looking over my shoulder and putting up
red error flags before I get to finish writing a line of code
is driving me nuts--how can I turn her off?

When I try to use a message-box for debugging, it often
destroys my ability to get out of the form--anything I
enter triggers the message-box and the next action of the
form -- even if I mouse-click on exit, design mode, code--
finally I lock up so thoroughly that the only way out is
reboot. [I haven't used Windows much 'til now, so I don't
know tricks about how to recover from lockups]

--thelma
: Arno R




rkc
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Ignoring spaces in combobox text: done,almost!


Thelma Lubkin wrote:
[color=blue]
> Two unrelated things I ran into while working on this:
>
> The spy-helper looking over my shoulder and putting up
> red error flags before I get to finish writing a line of code
> is driving me nuts--how can I turn her off?[/color]

While in the VBA editor tools>options>uncheck auto-syntax checking.
The offending line will still turn red, but the annoying error message
goes away.

[color=blue]
> When I try to use a message-box for debugging, it often
> destroys my ability to get out of the form--anything I[/color]

Use Debug.Print instead of a msgbox. You can be as verbose as you
want in your messages to yourself and view it all at once in the
immediate window (ctrl-G). Also read up on breakpoints and trace
code execution in the vba help.

Sorry, I have no clue what your actual problem is.




Thelma Lubkin
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Ignoring spaces in combobox text: done,almost!


rkc <rkc@rochester.yabba.dabba.do.rr.bomb> wrote:
:> When I try to use a message-box for debugging, it often
:> destroys my ability to get out of the form--anything I

: Use Debug.Print instead of a msgbox. You can be as verbose as you
: want in your messages to yourself and view it all at once in the
: immediate window (ctrl-G). Also read up on breakpoints and trace
: code execution in the vba help.

Thanks. I'll try that Debug.Print. I've used breakpoints and
watches and trace-code but I'm still more comfortable with
prints.
--thelma





Closed Thread