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