Current location: Hot Scripts Forums » Programming Languages » Visual Basic » Excel - Checking Access table for query and returning result


Excel - Checking Access table for query and returning result

Reply
  #1 (permalink)  
Old 11-24-04, 03:13 PM
lapsaj lapsaj is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Excel - Checking Access table for query and returning result

For this Im only using Excel and Access

Right got a query...

When I type 'x' in a text box in excel...then click a submit button....I want it to check a table for 'x'. although I only want it to search through the first column for 'x'. If it does find something then I want it to display YES in ths spreadsheet...if not then display NO.
Reply With Quote
  #2 (permalink)  
Old 11-24-04, 05:06 PM
koncept
Guest
 
Posts: n/a
its do able im not sure of the exact code for all of it, mostly how to open the database but the sql statement is
Code:
select count(*) as reccnt from table name where coulm like '% cell value %'
then you say if rs.reccnt > 0 then yes else no

i'll try and work something up tonight
Reply With Quote
  #3 (permalink)  
Old 11-25-04, 11:47 AM
lapsaj lapsaj is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Would it be do-able with an access DB?
Reply With Quote
  #4 (permalink)  
Old 11-25-04, 12:36 PM
koncept
Guest
 
Posts: n/a
yes that is very easy to do in access since it is database
Reply With Quote
  #5 (permalink)  
Old 11-25-04, 01:03 PM
lapsaj lapsaj is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
so what would the VB code be? Ive got the code to connect to the DB but how do I search in one column and return the result?
Reply With Quote
  #6 (permalink)  
Old 11-25-04, 06:47 PM
koncept
Guest
 
Posts: n/a
can you post the code that you have as i only know how to search using a sql statement suchas

select column, column from table where column like '%words%'
Reply With Quote
  #7 (permalink)  
Old 11-26-04, 11:16 AM
lapsaj lapsaj is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Its alrite now, Ive done it a different way. I just ran a query.
Reply With Quote
  #8 (permalink)  
Old 11-26-04, 11:19 AM
koncept
Guest
 
Posts: n/a
thats where i was hoping you would go, sorry i wasnt more direct about that
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
returning partial text from table... dsumpter PHP 6 07-22-04 04:43 PM


All times are GMT -5. The time now is 09:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.