View Full Version : Help with converting Access 97 to 2003


dobber
09-11-2007, 08:58 AM
Im new to the forum and am after some help.

I just converted a mdb to 2003 using the office converter and part of the database will not work. It should extract data put it into a workfile then move the details from teh workfile to the Internal Accreditation Tables.
Which is not working. Any help appreciated.
'

Private Sub awardlevel_AfterUpdate()
Dim Response, Style As String, stDocName As String
Dim dbsTraining As DAO.Database
Dim rstFilterAccred, rstIntAccred, rstIntAccredSub As DAO.Recordset
Dim strName, strMessage, strfirst, group, Course, Award, Subject, Desc1 As String
Dim Version, CPDhours, Dateissues As Variant
Dim PersNo, Intaccred As String
Dim wrkDefault As DAO.Workspace
Intaccred = Forms![employee details]![internal accred]![InternalAccred_PKey]
group = Forms![employee details]![internal accred]![Group_LookupID]
Course = Forms![employee details]![internal accred]![Course]
Award = Forms![employee details]![internal accred]![awardlevel]
If IsNull(Forms![employee details]![internal accred]![internal accred subject]![Subject Desc]) Then
Does not work from here i think
Style = vbYesNo + vbExclamation
Response = MsgBox("Confirm You Want To Add Subject Details For This Accreditation?" & vbCr & vbCr & "Group : " & group & vbCr & vbCr & "Course : " & Course & vbCr & vbCr & "Award : " & Award, Style, "Accreditation Details") 'Replaced by OfficeConverter 8.3.0 on line 44
' "Course : " & Course & Chr$(13) & Chr$(13) & "Award : " & Award, Style, "Accreditation Details")
! Does not work from here!!!
If Response = vbYes Then
DoCmd.SetWarnings False
stDocName = "Extract Internal Accred Grp"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "Extract Internal Accred course"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "Extract Internal Accred Award"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True

Set wrkDefault = DBEngine.Workspaces(0)
Set dbsTraining = DBEngine.OpenDatabase("db1.mdb")
Set rstIntAccredSub = dbsTraining.OpenRecordset("Internal Accred Subject", dbOpenTable)
Set rstIntAccred = dbsTraining.OpenRecordset("Internal Accred", dbOpenTable)
Set rstFilterAccred = dbsTraining.OpenRecordset("Filtered Internal Accred", dbOpenTable)
rstIntAccredSub.Index = "PersonelNo_Lookup"

Refresh

PersNo = Forms![employee details]![internal accred]![PersonelNo_Lookup]
Intaccred = Forms![employee details]![internal accred]![InternalAccred_PKey]
group = Forms![employee details]![internal accred]![Group_LookupID]
Course = Forms![employee details]![internal accred]![Course]
Award = Forms![employee details]![internal accred]![awardlevel]
DoCmd.GoToRecord , , acNewRec
With rstFilterAccred
Do Until rstFilterAccred.EOF
Subject = rstFilterAccred![Subject]
Version = rstFilterAccred![Version]
Dateissues = rstFilterAccred![Date Issues]


With rstIntAccredSub
.AddNew
rstIntAccredSub![InternalAccred_PKey] = Intaccred
rstIntAccredSub![PersonelNo_Lookup] = PersNo
rstIntAccredSub![Subject Desc] = Subject
rstIntAccredSub![Group_LookupID] = group
rstIntAccredSub![Course] = Course
rstIntAccredSub![awardlevel] = Award
rstIntAccredSub![Version] = Version
rstIntAccredSub![Date Issued] = Dateissues
.Update
End With

With rstFilterAccred
rstFilterAccred.MoveNext
End With

Loop
End With

dbsTraining.Close
Refresh

lagbolt
09-11-2007, 10:03 AM
Hey, welcome to the forum. Make it easier for people to help you by being more specific about what's not working. Do you get errors? If so, what line? Maybe it fails without errors? Runs, but doesn't do the job?
Cheers,

dobber
09-12-2007, 08:25 AM
I do not get any error messages, and the code seems to run ok but does not do what it used to do in 97. (just after red text) I am being asked for the response in the message box, but then it should refresh and add the details of the "Group, Course, and award". This is whats its not doing, could this have anything to do with the new security settings on 2003, which I am unable to change?