473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

DAO problem in Access 2003 - Can't find .Edit method for recordset

Someone is trying to run my Access 2002 database under Access 2003. He
has had a number of problems:

1) i used the MSComCt2.ocx for it's Date and Time picker. I can't find
it under 2003. Do I need to send it to them?

2) I have a function to fill a table with values, that store the page
and column numbers of a display of staff members. I had him check the
link to Microsoft DAO 3.6 Object Library under references, but it
still won't allow the method "recordset.edit". I am not sure why. I
don't have 2003 on my machine. I asked him to retype the line from VBA
and "edit" does not show up as a method in the autotype feature of the
VBA editor for the recordset. The code worked fine under Access 2000
and Access XP. Has VBA been drastically changed.

3) Any recommendations for book on using Access 2003?

Here is my code:

Public Sub Schedule_Make()
Dim db As Database
Dim RS As Recordset
Dim intStaffCount, IntCount, intPage, intPageCount, intPlaceHolder
As Integer
'open the data table
Set db = CurrentDb()
Set RS = db.OpenRecordset("Sched_Staff_Order")
'See how many staff are in the table
intStaffCount = DCount("Sched_ID", "Sched_Staff_Order")
'figure out how many pages are needed to list staff 5 across
intPageCount = intStaffCount / 5
If intStaffCount Mod 5 > 0 Then
intPageCount = intPageCount + 1
End If
RS.MoveFirst
intPlaceHolder = 1
For intPage = 1 To intPageCount 'cycle through page numbers
For IntCount = 1 To 5 ' cycle though columns
RS.Edit ' THIS DOES NOT COMPILE
RS!SchedulePage.Value = intPage
RS!ScheduleNum.Value = IntCount
RS.Update
intPlaceHolder = intPlaceHolder + 1 'keep count of
number of staff
If intPlaceHolder <= intStaffCount Then
RS.MoveNext
Else
Exit Sub ' when you reach the last staff person
End If
Next IntCount
Next intPage
Set RS = Nothing
Set db = Nothing
End Sub
Nov 13 '05 #1
5 7816
1) Yes, if he doesn't have the control, he will need it and it will need to
be added to the registry using Regsvr32.exe from the command prompt or Run
dialog.

2) Access uses the References in the order that the checked ones are listed
in the References window. If all he did was check DAO and click Ok, it would
have been placed at the bottom. Since ADO is checked above it, Access finds
the ADO Recordset first and quits looking. It would be possible to just
reorder the items in the dialog, it contains up/down arrows to do this, but
the better option is to change your DIM statements to get rid of the
ambiguity.

Dim RS As DAO.Recordset

Do this for ALL DAO objects just to be safe, but the one above is the main
one.

3) "Microsoft Office Access 2003 Inside Out"
"Access 2002 Developers Handbook" (there aren't a lot of changes between
2002 and 2003)

http://www.viescas.com/Info/books.htm
http://www.developershandbook.com

--
Wayne Morgan
MS Access MVP
"j.mandala" <ma*****@rci.rutgers.edu> wrote in message
news:6c**************************@posting.google.c om...
Someone is trying to run my Access 2002 database under Access 2003. He
has had a number of problems:

1) i used the MSComCt2.ocx for it's Date and Time picker. I can't find
it under 2003. Do I need to send it to them?

2) I have a function to fill a table with values, that store the page
and column numbers of a display of staff members. I had him check the
link to Microsoft DAO 3.6 Object Library under references, but it
still won't allow the method "recordset.edit". I am not sure why. I
don't have 2003 on my machine. I asked him to retype the line from VBA
and "edit" does not show up as a method in the autotype feature of the
VBA editor for the recordset. The code worked fine under Access 2000
and Access XP. Has VBA been drastically changed.

3) Any recommendations for book on using Access 2003?

Here is my code:

Public Sub Schedule_Make()
Dim db As Database
Dim RS As Recordset
Dim intStaffCount, IntCount, intPage, intPageCount, intPlaceHolder
As Integer
'open the data table
Set db = CurrentDb()
Set RS = db.OpenRecordset("Sched_Staff_Order")
'See how many staff are in the table
intStaffCount = DCount("Sched_ID", "Sched_Staff_Order")
'figure out how many pages are needed to list staff 5 across
intPageCount = intStaffCount / 5
If intStaffCount Mod 5 > 0 Then
intPageCount = intPageCount + 1
End If
RS.MoveFirst
intPlaceHolder = 1
For intPage = 1 To intPageCount 'cycle through page numbers
For IntCount = 1 To 5 ' cycle though columns
RS.Edit ' THIS DOES NOT COMPILE
RS!SchedulePage.Value = intPage
RS!ScheduleNum.Value = IntCount
RS.Update
intPlaceHolder = intPlaceHolder + 1 'keep count of
number of staff
If intPlaceHolder <= intStaffCount Then
RS.MoveNext
Else
Exit Sub ' when you reach the last staff person
End If
Next IntCount
Next intPage
Set RS = Nothing
Set db = Nothing
End Sub

Nov 13 '05 #2
ma*****@rci.rutgers.edu (j.mandala) wrote:
1) i used the MSComCt2.ocx for it's Date and Time picker. I can't find
it under 2003. Do I need to send it to them?


See the Calendar Tips page at my website
http://www.granite.ab.ca/access/calendars.htm

There could, likely will, be lots of version problems when you go to distribute the
MSCal.OCX..

One alternative is MonthCalendar is a completely API generated Month Calendar derived
directly from the Common Control DLL. There are links to several downloadable
calendar forms at my website. As these are forms you can also do anything with them
you want.

You can also use the calendar form which comes in the Access <insert your version
here> Developers Handbook by Litwin/Getz/Gilbert, publisher Sybex
www.developershandbook.com. These books are well worth spending money. Every time I
open one I save the price of the book.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #3
Thanks! I suspected there was something like that. I have changed all
the instances of Recordset to DAO.Recordset. Got my fingers crossed.
Thanks for this advice. I'm surprise that the ADO doesn't use
compatible methods and functions...

Jim
Nov 13 '05 #4
Thanks, Tony,

One alternative is MonthCalendar is a completely API generated Month Calendar derived
directly from the Common Control DLL. There are links to several downloadable
calendar forms at my website. As these are forms you can also do anything with them
you want.


This sounds like a better way to go. I knew there was a good reason
not to use that object. At the risk of sounding ignorant: what does it
mean to be API generated? What is the Common Control DLL, is this part
of Office or Windows?
Nov 13 '05 #5
ma*****@rci.rutgers.edu (j.mandala) wrote:
One alternative is MonthCalendar is a completely API generated Month Calendar derived
directly from the Common Control DLL. There are links to several downloadable
calendar forms at my website. As these are forms you can also do anything with them
you want.


This sounds like a better way to go. I knew there was a good reason
not to use that object. At the risk of sounding ignorant: what does it
mean to be API generated? What is the Common Control DLL, is this part
of Office or Windows?


API generated means you deal directly with the DLLs involved. The code looks uglier
at first glance but is usually just a matter of copying in the code to a seperate
module and you use it.

The Common Control DLL is part of Windows. The Calendar Control is a wrapper for
this DLL.

The big advantage of not using the Calendar control is that you no longer have to
worry about the version and distributing it. The DLLs are built right into Windows
so you just use them. And there is no versioning when it comes to using DLLs.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
6
by: Marlene | last post by:
Hi All I have the following scenario, where I have found all the duplicates in a table, based on an order number and a part number (item).I might have something like this: Order PODate Rec...
2
by: Nono | last post by:
Hello, I have an Access Database that I want to update using an Excel spreadsheet. When it is new reccords, I know how to do it. Nevertheless when I want to complete the information on a...
21
by: Madingo | last post by:
I have been using Access 2003 for about a year and I am trying to find out how to create a web test environment to try and transition some of my Access applications on to the web. My stumbling...
12
by: Cy | last post by:
Hello Fellow New Group Folks, Here's today's problem. I was called in to help convert an Access 97 database to Access 2000. 99% of all my Access Dev. work has occurred in 2000, so I know very...
31
by: Cy | last post by:
Hi all, I wanted to start a thread that might help many of us. I worked for a company for 12 years, until this past Christmas when they let me go. Getting rid of the higher dollar guys, in...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
7
by: PW | last post by:
Hi, I have a form with unbound fields on it. The user selects a record from a recordset and I populate the unbound fields. When I try to change the unbound quantity text box, Access 2003 tells...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.