calculate sign module

U

Uhl

I have a module with the Function SignKZ and a field called Bdate

How do I get the result of this function in my form?


Function SignKZ(Bdate As Date) As String
Dim X
Dim Y

If (Not IsDate(Bdate)) Or (Bdate = 0) Then 'Wenn falsches Datum dann Today
X = Day(Date)
Y = Month(Date)
Else
X = Day(Xdatum)
Y = Month(Xdatum)
End If

If (X > 20 And Y = 3) Or (X < 21 And Y = 4) Then
TierKZ = "Widder"
ElseIf (X > 20 And Y = 4) Or (X < 21 And Y = 5) Then
TierKZ = "Stier"
ElseIf (X > 20 And Y = 5) Or (X < 22 And Y = 6) Then
TierKZ = "Zwilling"
ElseIf (X > 21 And Y = 6) Or (X < 23 And Y = 7) Then
TierKZ = "Krebs"
ElseIf (X > 22 And Y = 7) Or (X < 24 And Y = 8) Then
TierKZ = "Löwe"
ElseIf (X > 23 And Y = 8) Or (X < 24 And Y = 9) Then
TierKZ = "Jungfrau"
ElseIf (X > 23 And Y = 9) Or (X < 24 And Y = 10) Then
TierKZ = "Waage"
ElseIf (X > 23 And Y = 10) Or (X < 23 And Y = 11) Then
TierKZ = "Skorpion"
ElseIf (X > 22 And Y = 11) Or (X < 22 And Y = 12) Then
TierKZ = "Schütze"
ElseIf (X > 21 And Y = 12) Or (X < 21 And Y = 1) Then
TierKZ = "Steinbock"
ElseIf (X > 20 And Y = 1) Or (X < 20 And Y = 2) Then
TierKZ = "Wassermann"
ElseIf (X > 19 And Y = 2) Or (X < 21 And Y = 3) Then
TierKZ = "Fische"
End If

End Function
 
D

Daryl S

Uhl -

Within your function (usually at the end), you need to set the resulting
string to your function name. If you want to return the value of TierKZ,
then you would put this statement after it is calculated, but before the end
of the function:

SignKZ = TierKZ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top