Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List certain tables 1

Status
Not open for further replies.

tekthis

MIS
Jun 9, 2004
77
0
0
US
i have a program that i search a database and it populates a combobox with all of the tables...

is it possible for me to add only certain tables and not all of them???

the tables i want shown all have 2004 in their name...i.e. August2004, Sept2004, etc. (if this info helps)

i tired this...

If Right(Trim(cmbTables.Text), 4) = "2004" Then
Do While Not Rs.EOF
cmbTables.AddItem Rs("TABLE_NAME")
Rs.MoveNext
Loop
Else
Exit Sub
End If

when i leave the if statement off it fills the combobox with ALL of the tables...when i have it on NO tables are shown...thanks for your time...
 
Try this:

Do While Not Rs.EOF
if instr(Rs("TABLE_NAME"), "2004") <> 0 then
cmbTables.AddItem Rs("TABLE_NAME")
end if
Rs.MoveNext
Loop


Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
perfect...thanks DrJavaJoe...heres a star...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top