Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2006, 11:37 AM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dcount with local disconnected recordset

I am trying to run a Dcount to find duplicates in my recordset, but I get an error telling me that the Jet engine can't find the local disconnected recordset (although I have a watch on it and it is perfectly fine, right there in memory). I have the same problem when I try to run a report off this recordset. Do I have to copy the whole table from the backend again just to check for duplicates?

 
Old March 10th, 2006, 11:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Using the query wizard, you can create a query that does that for you. No need to recreate the wheel. Have you tried it yet?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old March 10th, 2006, 11:55 AM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I don't actually have any tables in the frontend. Just the forms and the reports.

 
Old March 10th, 2006, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

That doesn't matter. As long as your forms and reports are linked to the back end and getting their data, the queries can also link to the tables in the back end.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old March 10th, 2006, 12:02 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't have any active links. I use the ADO to load the data to the local disconnected recordset and release the connection. Once all the data entry etc. is done, I re-connect to do a batch update. That's why my recordset is only locally present.
PS: I get an error when I try to run the query wizard. Telling me there is no query or table.
 
Old March 10th, 2006, 12:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Ah, gotcha. In that case I suggest this. Create a small table with a couple of records in them in your front end. Run the query wizard on THAT table. Tell it you want to find duplicates in your table. After the query is created, open it in SQL view. Copy the SQL code you see and then paste it into your VBA code. Change the names of table and fields in your new VBA code to match the REAL recordset you want to work on. Once you got it working, delete the test table and test query.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old March 10th, 2006, 12:08 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great idea. I will try that now. Thanks so much.

 
Old March 10th, 2006, 01:44 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried it, so far no luck. Do you think I have to run the query on the connection to the backend? I tried to again run it on the local recordset. Somehow Access doesn't seem to want to work with that recordset at all.






Similar Threads
Thread Thread Starter Forum Replies Last Post
DCount problem using vba Vince_421 VB Databases Basics 1 March 30th, 2007 02:26 PM
Report from disconnected recordset DreamEagl Access VBA 4 January 9th, 2006 04:26 PM
VB Collection object Vs Disconnected Recordset Andypat Pro VB Databases 1 February 15th, 2005 06:57 PM
DCOUNT Issue - MS Access 97 snoopy92211 Access VBA 1 October 12th, 2004 02:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.