Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Matilda Hughes   on Oct 29 In MS Office Category.

  
Question Answered By: Rebekah Walker   on Oct 29

I am unable to see quickly what your code is supposed to be doing. It is
too long and unexplained to be a reasonable quote in a message. And you
really are not saying where your problem is.

Please (1) cut down your code until it demonstrates your problem, and
nothing else, (2) explain exactly what your problem is, (3) provide
step-by-step examples of what needs to happen.

However, some general comments ...

> Dim strFind, FirstAddress As String

This code is wrong. strFind will be declared as variant, not string.
Please only put one declaration on each Dim statement. It's safer and also
easier to read.

> I am using strFind to let me search  ...

strfind is the name of a search function in MATLAB. You don't appear to be
using it. You have defined a local variable called strFind to hold
something from a text box, that you then use in a Find call.

> I am using case  to fill in the info on the form.

This is sort of true, but actually the Case statement  isn't achieving
anything.

You have a For loop from 1 to 12, then immediately use a Case statement to
break the For loop back out into separate statements again.

From what I can see, you could (and should) do this with 12 separate
assignment statements - one for each of the 12 text boxes. In fact, your
loop is 14 lines, so using separate assignment statements would not only be
easier to read, and quicker - it'd also be shorter.

> I would like to change the search from just one textbox
> into a search from any textbox.

The loop and the case statement are associated with putting things into
textboxes. They are not associated with your search, so I'm not sure why
they form a part of your description.

What do you mean by a search from any textbox? Do you mean that you want to
combine the information  from the textboxes in some way and use that as a
search key? Do you mean that you want the user to be able to specify which
text box to take the search string from? Do you mean that you want to try
the information from one textbox  after another until you get a find?

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Using Case to do a multi-textbox search Or get search suggestion and latest updates.


Tagged: