P
Peter McNaughton
Hi
I am trying to access each record in a table, detect for the presence
of a P O Box and I will then move that information into a new PO Box
field.
But before I could complete the procedure I get a compile error. I
have seen many examples in the access news groups that suggest the
code should work. Why do I get the error "User defined type not
defined?"
Thanks in advance
Peter
Private Sub Postcode()
Dim myDB As Database
Dim myRst As Recordset
Set myDB = CurrentDb
Set myRst = myDB.OpenRecordset("tblPersonal Details")
myRst.MoveFirst
Do Until myRst.EOF
If myRst![Address Line1] = "P O Box" Then
myRst![PO Box] = myRst![Address Line1]
End If
myRst.MoveNext
Loop
End Sub
I am trying to access each record in a table, detect for the presence
of a P O Box and I will then move that information into a new PO Box
field.
But before I could complete the procedure I get a compile error. I
have seen many examples in the access news groups that suggest the
code should work. Why do I get the error "User defined type not
defined?"
Thanks in advance
Peter
Private Sub Postcode()
Dim myDB As Database
Dim myRst As Recordset
Set myDB = CurrentDb
Set myRst = myDB.OpenRecordset("tblPersonal Details")
myRst.MoveFirst
Do Until myRst.EOF
If myRst![Address Line1] = "P O Box" Then
myRst![PO Box] = myRst![Address Line1]
End If
myRst.MoveNext
Loop
End Sub