A
ally
Hello
I am trying to make a function work which would enable me to do a
mailing.
My fields are
Table: Clients
RefClient
Titre
NomFamille
Prénom
Societé/Entreprise
ContactPersonne
Adresse
Code
Ville
Pays
all text except the first one Auto Entier long
My function is
Function Adresses(pvarNoAdr As Variant, Optional pfSansNom As Boolean)
As Variant
Dim RefClient As Long
If Not TablesOpen Then OpenTables
Adresses = Null
If IsNull(pvarNoAdr) Then Exit Function
RefClient = CLng(pvarNoAdr)
With Clients
.Seek "=", RefClient
If .NoMatch Then Exit Function
If Not pfSansNom Then
Adresse = ! Titre + vbCrLf & ! Prénom + " " & ! NomFamille
Else
Adresse = "?"
End If
Adresse = Adresse _
& vbCrLf + ! Société/Entreprise +!ContactPersonne
& vbCrLf + ! Adresse _
& vbCrLf +!Pays + "-"_& ! CodePostal & " " + ! Ville
If pfSansNom Then _
Adresse = Mid(Adresse, 4)
End With
End Function
And it does not work !
Could somebody please help me correct this code.
I do not understand a lot of VBA I am just trying to convert some code
found somewhere else
I thought it right to make a report with a text field
And to put this function in a module.
Thank you in advance
ally
I am trying to make a function work which would enable me to do a
mailing.
My fields are
Table: Clients
RefClient
Titre
NomFamille
Prénom
Societé/Entreprise
ContactPersonne
Adresse
Code
Ville
Pays
all text except the first one Auto Entier long
My function is
Function Adresses(pvarNoAdr As Variant, Optional pfSansNom As Boolean)
As Variant
Dim RefClient As Long
If Not TablesOpen Then OpenTables
Adresses = Null
If IsNull(pvarNoAdr) Then Exit Function
RefClient = CLng(pvarNoAdr)
With Clients
.Seek "=", RefClient
If .NoMatch Then Exit Function
If Not pfSansNom Then
Adresse = ! Titre + vbCrLf & ! Prénom + " " & ! NomFamille
Else
Adresse = "?"
End If
Adresse = Adresse _
& vbCrLf + ! Société/Entreprise +!ContactPersonne
& vbCrLf + ! Adresse _
& vbCrLf +!Pays + "-"_& ! CodePostal & " " + ! Ville
If pfSansNom Then _
Adresse = Mid(Adresse, 4)
End With
End Function
And it does not work !
Could somebody please help me correct this code.
I do not understand a lot of VBA I am just trying to convert some code
found somewhere else
I thought it right to make a report with a text field
And to put this function in a module.
Thank you in advance
ally