Joshua B
lists at jbsolutions.com.au
Wed Jun 25 03:12:12 CDT 2003
Dear Kostas Konstantinidis:
You havent declared your "db" and "rs" variables. Under "Dim strMsg as String", put
Dim db as DAO.Database
Dim rs as DAO.Recordset
======== At 2003-06-25, 10:59:00 you wrote: ========
Hi all,
I need some help please with an error message
when I try to enter a new record into... I get the follown error
Compile error
variable not defined
the code:
Private Sub idpoli_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
strMsg = "'" & NewData & "' bla bla"
strMsg = strMsg & "@bla bla;"
strMsg = strMsg & "@bla bla."
If MsgBox(strMsg, vbQuestion + vbYesNo, "new data") = vbNo Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("T_poli", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!poli = NewData
rs.Update
If Err Then
MsgBox "bla bla."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub
Thank's a lot
Kostas Konstantinidis
= = = = = = = = = = = = = = = = = = = = = =
Best regards.
Joshua B
lists at jbsolutions.com.au
www.jbsolutions.com.au
2003-06-25
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030625/baa0391b/attachment-0001.html>