Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a spreadsheet that exports data into Access. I used ADO/DAO to do this without a problem. I am adding more functionality to the spreadsheet and want to be able to tell if i am going to add duplicate records before they get added. I want Excel to look at two columns in Access - "Year" and "Month" and if they are the same as the year and month of the data that I am about to enter I want a message to pop-up warning me that I could be entering duplicate information. I've tries the following: sSQL = "SELECT * FROM Activity WHERE ([ReportingMonth]=1 AND ReportingYear]=2004/2005)" rs.Open sSQL, cn MsgBox rs.RecordCount If rs.RecordCount 0 Then MsgBox "duplication possible" but the problem i come across is that rs.RecordCount displays "-1" even when i have thousands of records that match the criteria. Can anyone point out where i am going wrong. many thanks in advance chris dunigan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error in querying data from MS Access | Excel Discussion (Misc queries) | |||
QUERYING ACCESS | Excel Discussion (Misc queries) | |||
Querying data from Access | Excel Worksheet Functions | |||
Querying Data from Access | Excel Discussion (Misc queries) | |||
Querying Access Database | Excel Worksheet Functions |