Private Sub CopyPreferred()

Dim oRec As CRecord
Set oRec = New CRecord

oRec.Init REApplication.SessionContext
oRec.Load 280

Dim sBlock As String
Dim sCity As String
Dim sState As String
Dim sZip As String

Dim oAdd As CConstitAddress

For Each oAdd In oRec.Addresses
If oAdd.Fields(CONSTIT_ADDRESS_fld_PREFERRED) = -1 Then
sBlock = oAdd.Fields(CONSTIT_ADDRESS_fld_ADDRESS_BLOCK)
sCity = oAdd.Fields(CONSTIT_ADDRESS_fld_CITY)
sState = oAdd.Fields(CONSTIT_ADDRESS_fld_STATE)
sZip = oAdd.Fields(CONSTIT_ADDRESS_fld_POST_CODE)
Exit For
Else: End If
Next oAdd

With oRec.Addresses.Add
.Fields(CONSTIT_ADDRESS_fld_ADDRESS_BLOCK) = sBlock
.Fields(CONSTIT_ADDRESS_fld_CITY) = sCity
.Fields(CONSTIT_ADDRESS_fld_STATE) = sState
.Fields(CONSTIT_ADDRESS_fld_POST_CODE) = sZip
.Validate
End With


oRec.Validate
oRec.Save
oRec.Closedown
Set oRec = Nothing

End Sub