P
phillip9
Hello,
I'm having problems with forms & VBA imported from Access 7.0.
I'm getting compiler errors on lines that appear to be fine, such as the
following:
set rs2 = currentdb().openrecordset(strsql2, dbopensnapshot)
ERROR "compile error: variable not defined) error is highlighting
(dbopensnapshot)
I also get errors on lines that are trying to DIM DB as DATABASE
ERRROR "user-defined type not defined" error is highlighting (db as
DATABASE)
Anything would help me a lot, thanks.
-----------------------------------------
CODE:
-------------------------------------------
Private Sub txtIndex_Click()
Dim rs As RECORDSET
Dim rs2 As RECORDSET
Dim db As DATABASE
Dim strSQL2 As String
Set db = CurrentDb()
If IsNull(txtIndex.Value) Or txtIndex.Value = "" Then
Exit Sub
End If
strSQL2 = "SELECT * FROM 2530 ORDER BY projnum"
Set rs = db.openrecordset("proi", dbopensnapshot)
Set rs2 = db.openrecordset(strSQL2, dbopensnapshot)
rs2.findfirst "index = " & txtIndex
If rs2.nomatch Then
Exit Sub
Else
txtProjnum = rs2!PROJNUM
txtPrincipals = rs2!principals
txtReceivedDate = rs2!receiveddate
txtAppsCheck = rs2!appscheck
TXTSentToDetroit = rs2!senttodetroit
txtSentToHQ = rs2!senttohq
txtReceivedBack = rs2!receivedback
txtCleared = rs2!cleared
End If
rs.findfirst "projnum = '" & txtProjnum & "'"
If rs.nomatch Then
txtProjname = ""
txtServicer = ""
Else
txtProjname = rs!PROJNAME
txtServicer = rs!SERVICER
End If
rs.Close
rs2.Close
txtPrincipals.Visible = True
txtPrincipals.Enabled = True
txtPrincipals.Locked = False
End Sub
I'm having problems with forms & VBA imported from Access 7.0.
I'm getting compiler errors on lines that appear to be fine, such as the
following:
set rs2 = currentdb().openrecordset(strsql2, dbopensnapshot)
ERROR "compile error: variable not defined) error is highlighting
(dbopensnapshot)
I also get errors on lines that are trying to DIM DB as DATABASE
ERRROR "user-defined type not defined" error is highlighting (db as
DATABASE)
Anything would help me a lot, thanks.
-----------------------------------------
CODE:
-------------------------------------------
Private Sub txtIndex_Click()
Dim rs As RECORDSET
Dim rs2 As RECORDSET
Dim db As DATABASE
Dim strSQL2 As String
Set db = CurrentDb()
If IsNull(txtIndex.Value) Or txtIndex.Value = "" Then
Exit Sub
End If
strSQL2 = "SELECT * FROM 2530 ORDER BY projnum"
Set rs = db.openrecordset("proi", dbopensnapshot)
Set rs2 = db.openrecordset(strSQL2, dbopensnapshot)
rs2.findfirst "index = " & txtIndex
If rs2.nomatch Then
Exit Sub
Else
txtProjnum = rs2!PROJNUM
txtPrincipals = rs2!principals
txtReceivedDate = rs2!receiveddate
txtAppsCheck = rs2!appscheck
TXTSentToDetroit = rs2!senttodetroit
txtSentToHQ = rs2!senttohq
txtReceivedBack = rs2!receivedback
txtCleared = rs2!cleared
End If
rs.findfirst "projnum = '" & txtProjnum & "'"
If rs.nomatch Then
txtProjname = ""
txtServicer = ""
Else
txtProjname = rs!PROJNAME
txtServicer = rs!SERVICER
End If
rs.Close
rs2.Close
txtPrincipals.Visible = True
txtPrincipals.Enabled = True
txtPrincipals.Locked = False
End Sub