G
Guest
My boss asked me to design a form modeled after something in an Access 2000
handbook. I have done this I think, but when the user makes their selection,
Access becomes "Non Responding" and the cpu usage goes to 100%. Would
someone mind looking at the code, please? It is a very basic search and fill
in the field form.
This is where I think it locks:
Public Function Load() As Boolean
Dim rst As ADODB.Recordset
On Error GoTo HandleErrors
Set rst = New ADODB.Recordset
rst.Open "Select * from tblCourse Where ID = " & Me.Title,
Application.CurrentProject.Connection
With rst
If Not .EOF Then
mstrTitle = !Title
mstrVersion = !Version
mlngCIC_Type = !CIC_Type
mlngCIC_Num = !CIC_Num
mlngCourseNum = !CourseNum
mlngHours = !Hours
mlngDays = !Days
mstrClearance = !Clearance
mstrPrice = !Price
mlngRole = !Role
mlngVendor = !Vendor
mfQual = !Qual
mfPPE = !PPE
mstrAbstract = !Abstract
mlngCourseID = !ID
End If
End With
Load = True
ExitHere:
If Not rst Is Nothing Then rst.Close
Set rst = Nothing
Exit Function
HandleErrors:
Load = False
Resume ExitHere
End Function
handbook. I have done this I think, but when the user makes their selection,
Access becomes "Non Responding" and the cpu usage goes to 100%. Would
someone mind looking at the code, please? It is a very basic search and fill
in the field form.
This is where I think it locks:
Public Function Load() As Boolean
Dim rst As ADODB.Recordset
On Error GoTo HandleErrors
Set rst = New ADODB.Recordset
rst.Open "Select * from tblCourse Where ID = " & Me.Title,
Application.CurrentProject.Connection
With rst
If Not .EOF Then
mstrTitle = !Title
mstrVersion = !Version
mlngCIC_Type = !CIC_Type
mlngCIC_Num = !CIC_Num
mlngCourseNum = !CourseNum
mlngHours = !Hours
mlngDays = !Days
mstrClearance = !Clearance
mstrPrice = !Price
mlngRole = !Role
mlngVendor = !Vendor
mfQual = !Qual
mfPPE = !PPE
mstrAbstract = !Abstract
mlngCourseID = !ID
End If
End With
Load = True
ExitHere:
If Not rst Is Nothing Then rst.Close
Set rst = Nothing
Exit Function
HandleErrors:
Load = False
Resume ExitHere
End Function