Wildcard programming help required 
Author Message
 Wildcard programming help required

Hi - I work in a sports academy which codes its classes using 5
characters.  (a-z  a-z  0-9  0-9  0-9)  A typical class codes is  fp216,
which is interpreted as Fall session, Parent & Tot, running on Tuesday,
class #16.

I need to design a form having a textbox which supports both * (any
number of characters) and  ? (one character)  wildcards.  Entering fp*,
for example, would cause all Fall Parent & Tot classes to be listed in
the adjacent combobox.   I need to be able to handle entries like
fp*,   w?4*, s?4?6, u*76, *4??.

I've spent a long time on this, but this calls for a better programmer
than me!  I'd be grateful for any help.       Brian D.



Tue, 07 Jan 2003 03:00:00 GMT  
 Wildcard programming help required
In the Source Query for the combobox use a where clause that is

   WHERE ClassCode Like NZ(Forms!FormName.txtInput,"*")

If you are using the query grid the criteria for ClassCode would be

   Like NZ(Forms!urFormName.txtInput,"*")

Quote:

> Hi - I work in a sports academy which codes its classes using 5
> characters.  (a-z  a-z  0-9  0-9  0-9)  A typical class codes is  fp216,
> which is interpreted as Fall session, Parent & Tot, running on Tuesday,
> class #16.

> I need to design a form having a textbox which supports both * (any
> number of characters) and  ? (one character)  wildcards.  Entering fp*,
> for example, would cause all Fall Parent & Tot classes to be listed in
> the adjacent combobox.   I need to be able to handle entries like
> fp*,   w?4*, s?4?6, u*76, *4??.

> I've spent a long time on this, but this calls for a better programmer
> than me!  I'd be grateful for any help.       Brian D.



Tue, 07 Jan 2003 03:00:00 GMT  
 Wildcard programming help required
I'm not sure what your question is.  My guess is that you want to know how
force the combo box to display only matching classes if the text box is not
empty, or to display all classes if the text box is empty.

You can do this by first setting up the combo box with a default row source
that displays all classes -- something like this:

    SELECT ClassCode, ClassDescription FROM tblClasses;

and then changing the rowsource whenever the text box is updated, like this:

    Private Sub txtClassFilter_AfterUpdate()
        If Len(Me!txtClassFilter & "") > 0 Then
            Me!cboClass.RowSource =  _
                "SELECT ClassCode, ClassDescription FROM tblClasses " & _
                "WHERE ClassCode Like '" & Me!txtClassFilter & "';"
        Else
            Me!cboClass.RowSource =  _
                "SELECT ClassCode, ClassDescription FROM tblClasses;"
        End If
    End Sub

Is this the sort of thing you were looking for?
--

Dirk Goldgar
(remove NOSPAM from reply address)


Quote:
> Hi - I work in a sports academy which codes its classes using 5
> characters.  (a-z  a-z  0-9  0-9  0-9)  A typical class codes is  fp216,
> which is interpreted as Fall session, Parent & Tot, running on Tuesday,
> class #16.

> I need to design a form having a textbox which supports both * (any
> number of characters) and  ? (one character)  wildcards.  Entering fp*,
> for example, would cause all Fall Parent & Tot classes to be listed in
> the adjacent combobox.   I need to be able to handle entries like
> fp*,   w?4*, s?4?6, u*76, *4??.

> I've spent a long time on this, but this calls for a better programmer
> than me!  I'd be grateful for any help.       Brian D.



Tue, 07 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Program pause help required

2. MAPI programming help required

3. HELP --> Source of a program required

4. Require help with VB program on IIS

5. HELP --> Source of a program required

6. Require help with VB program on IIS 3.0

7. Wildcard input for text searching program

8. Guru required - Help, Help, Help - ASP and SCRIPT

9. Help with wildcards

10. req help: wildcards in URL

11. Database Program Examples Required

12. HELP! Wildcard problem

 

 
Powered by phpBB® Forum Software