integritycare
Technical User
Hi Guys,
Dont know if it was a good idea to change from Access 2003 to Access 2007. The following code works ok in Access 2003, but crashes the database in access 2007
Could someone give me some clues as to why, and if the gurus could tell whether to stay with access 2003.
Many Thanks,
Integrity
Dont know if it was a good idea to change from Access 2003 to Access 2007. The following code works ok in Access 2003, but crashes the database in access 2007
Code:
Private Sub cboTax_AfterUpdate()
On Error Resume Next
Dim rs As ADODB.Recordset
Dim strSql As String
cboTax.SetFocus
If cboTax.Value > 0 Then
strSql = "SELECT * FROM [tblTaxType-Accts] WHERE TaxType = " & cboTax.Value
Set rs = CreateObject("ADODB.Recordset")
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open strSql, CurrentProject.Connection
If rs.State = 1 Then
If Not rs.BOF Then
Me.Tax = rs("type")
Me.TaxPrefix = rs("Prefix")
End If
rs.Close
End If
Set rs = Nothing
End If
End Sub
Could someone give me some clues as to why, and if the gurus could tell whether to stay with access 2003.
Many Thanks,
Integrity