D
Don
I am using Access 2000 and I am working through an access visual basic book
that is for Access version 7. In the book is a lesson with code that allows
the user to choose if they want to entering the zip code or not. The book
uses certain objects that I think may not be in Access 2000 (just my guess).
The following is the code the book suggests:
Private Sub Form_BeforeUpdate(Cancel As Integer)
' If the user entered an address, check for a zip code.
Dim strMessage As String
Dim intOptions As Interger
Dim bytChoice As Byte
If Not IsNull(Address) And IsNull(PostalCode) Then
strMessage = "You didn't enter a postal code. Save anyway?"
intOptions = vbQuestion + vbOKCancel
bytChoice = MsgBox(strMessage, intOptions)
If bytChoice = vbCancel Then
PostalCode.SetFocus 'Go back to PostalCode field.
Cancel = True 'Cancel saving the record.
End If
End If
When compiled,
"intOptions As Interger"
is higlighted and a window pops up with the message "Can't find project or
library".
Then the references window opens with the MicroSoft Visual Basic for
Applications Extensibility 5.3 checked. I have tried to choose different DLL
or OLB libraries and have tried all that Access will allow but cannot find
the object. Has anyone had this problem? What can I do to address this
problem?
Thanks,
Dennis
that is for Access version 7. In the book is a lesson with code that allows
the user to choose if they want to entering the zip code or not. The book
uses certain objects that I think may not be in Access 2000 (just my guess).
The following is the code the book suggests:
Private Sub Form_BeforeUpdate(Cancel As Integer)
' If the user entered an address, check for a zip code.
Dim strMessage As String
Dim intOptions As Interger
Dim bytChoice As Byte
If Not IsNull(Address) And IsNull(PostalCode) Then
strMessage = "You didn't enter a postal code. Save anyway?"
intOptions = vbQuestion + vbOKCancel
bytChoice = MsgBox(strMessage, intOptions)
If bytChoice = vbCancel Then
PostalCode.SetFocus 'Go back to PostalCode field.
Cancel = True 'Cancel saving the record.
End If
End If
When compiled,
"intOptions As Interger"
is higlighted and a window pops up with the message "Can't find project or
library".
Then the references window opens with the MicroSoft Visual Basic for
Applications Extensibility 5.3 checked. I have tried to choose different DLL
or OLB libraries and have tried all that Access will allow but cannot find
the object. Has anyone had this problem? What can I do to address this
problem?
Thanks,
Dennis