[AccessD] Compile error

Mark H Lists at theopg.com
Wed Jun 25 03:08:44 CDT 2003


you need to "Dim db as Database" somewhere...
 
mark

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas
Konstantinidis
Sent: 25 June 2003 08:59
To: accessd at databaseadvisors.com
Subject: [AccessD] Compile error


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030625/d6954308/attachment-0001.html>


More information about the AccessD mailing list