LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA duplication

Thanks, im slowly getting there i think. Its now accepting the code but it is
still updating the record set. I need it to bring a message box up and not to
update the record set if the mySQL slect finds a match. Im new to visual
basic so any help is appreciated, thanks

Paul

"Keith74" wrote:

Hi

The code i posted was more of a general principle thing as i don't
know exactly how you're set up. To make it a little more prescriptive
the select should be something like

mySQL = "SELECT PortfolioName FROM <tablename where PortfolioName is
found WHERE PortfolioName = ''" & <your textboxname.value & "'"

What we're doing is running a simple select to determine is the name
in your textbox already exists on the database. The results of the
query are checked using

If myRecordsSet.BOF = True and myRecordsSet.EOF = True then

The "myRecordSet" is whatever you have Dimmed you recordset object as,
and the "myRecordsSet.BOF = True and myRecordsSet.EOF" checks to see
if the recordset is empty, i.e that name doesn't exist on the table.

If you're still having trouble pm me.

Keith




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplication Lorenza@hsccs Excel Worksheet Functions 1 May 5th 10 06:10 PM
Duplication PMST Excel Discussion (Misc queries) 2 February 19th 08 03:18 PM
Duplication Welthey Excel Discussion (Misc queries) 2 January 15th 07 09:48 PM
no duplication please asmenut Excel Programming 2 August 10th 05 09:19 PM
Duplication Wonderer[_2_] Excel Programming 15 June 10th 05 03:17 AM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"