By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.