PC Review


Reply
Thread Tools Rate Thread

check double records in database

 
 
tinybears
Guest
Posts: n/a
 
      11th May 2006
Hey,

I'm looking for a code to know if a row with primarty key ticker is
already in my table DDM.
I use the following code but there seem som problems. It says the
variable TextTicker.Text is not defined. Can someone help me out? Thx

s_Path = ActiveWorkbook.Path
s_Path = s_Path & "\Thesis.mdb"

Set DB = DAO.OpenDatabase(s_Path)

s_SQL = "SELECT Ticker & FROM DDM " _
& "WHERE Ticker = ' & Me.TextTicker & " ';"


If s_SQL = TextTicker.Text Then

MsgBox "Found"

Else

MsgBox "Not found"
GoTo execute_code:


End If

Set rs = Nothing
Set DB = Nothing

execute_code:

 
Reply With Quote
 
 
 
 
Puppet_Sock
Guest
Posts: n/a
 
      11th May 2006
tinybears wrote:
> I'm looking for a code to know if a row with primarty key ticker is
> already in my table DDM.
> I use the following code but there seem som problems. It says the
> variable TextTicker.Text is not defined. Can someone help me out? Thx
>
> s_Path = ActiveWorkbook.Path
> s_Path = s_Path & "\Thesis.mdb"
>
> Set DB = DAO.OpenDatabase(s_Path)
>
> s_SQL = "SELECT Ticker & FROM DDM " _
> & "WHERE Ticker = ' & Me.TextTicker & " ';"
>
>
> If s_SQL = TextTicker.Text Then
>
> MsgBox "Found"
>
> Else
>
> MsgBox "Not found"
> GoTo execute_code:
>
>
> End If
>
> Set rs = Nothing
> Set DB = Nothing
>
> execute_code:


Ok, I'm looking, and I don't see anywhere that TextTicker is defined,
except possibly as part of "Me" which itself is not defined. So, what
if you put Me.TextTicker instead of TextTicker? Is Me defined?

Also, the line

> If s_SQL = TextTicker.Text Then


looks pretty weird. It looks like s_SQL is supposed to be a SQL
command, so presumably there's a database around someplace.
Why do you expect TextTicker.Text to be equal to this command?

The rest looks pretty weird also. If the equality is true, then you
set rs and DB to Nothing. But if it is not true, you don't. What's up
with that? And what is rs?

Also, if it is a SQL command, are you planning to execute it?

I think you need a book to read about this stuff. You seem to have
plenty of problems.
Socks

 
Reply With Quote
 
tinybears
Guest
Posts: n/a
 
      11th May 2006
That's why I'm freaking out about it. I need to hand it in next week. O
well ...

thx for your honest reply

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I double check that there are no formulas 2468NICKIL Microsoft Excel Worksheet Functions 2 27th Apr 2010 12:49 PM
access database to check in and out records - ip address networks =?Utf-8?B?c2NvdHQ=?= Microsoft Access Forms 1 21st Feb 2006 06:45 AM
double records =?Utf-8?B?dmlrdG9y?= Microsoft Excel Worksheet Functions 4 20th Nov 2005 08:13 AM
A double check, please Stuart Microsoft Excel Programming 9 21st Apr 2005 11:06 PM
Double records Warrio Microsoft Access Queries 1 3rd May 2004 01:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:51 PM.