With this code i take out the birthday date from a socialnumber (personnummer in sweden)
For example the number could be 8305065588
83 = year 1983
05 = month may
06 = day 06 in that month
last 4 digits are irrelevant here...
this code works fine.
i get a date and it works great to print it in the txtBirthdayDate object.
However
Now i want to create an alert/warning
something like this
how can i do this?
i also want to create an alert/event that warns 10 days, 9 days, 8 days etc before an birthday are comming up.
something like
anyone able to help me do this?
i work in access 2016
Code:
Sub GetBirthdayDate()
Application.Echo False
On Error GoTo PROC_ERR
Dim dat
Dim year
Dim mounth
Dim day
Dim age
year = Left(Form_Profile_Form.txtProfilePersonnummer, 2)
mounth = Mid(Form_Profile_Form.txtProfilePersonnummer, 3, 2)
day = Mid(Form_Profile_Form.txtProfilePersonnummer, 5, 2)
dat = DateSerial(year, mounth, day)
dat = Format(dat, "DD MMMM")
Form_Profile_Form.txtBirthdayDate = " den " & dat
PROC_ERR:
Application.Echo True
Exit Sub
Application.Echo True
End Sub
For example the number could be 8305065588
83 = year 1983
05 = month may
06 = day 06 in that month
last 4 digits are irrelevant here...
this code works fine.
i get a date and it works great to print it in the txtBirthdayDate object.
However
Now i want to create an alert/warning
something like this
Code:
if dat = todaysdate then
msgbox "BIRTHDAY BIRTHDAY"
else
end if
how can i do this?
i also want to create an alert/event that warns 10 days, 9 days, 8 days etc before an birthday are comming up.
something like
Code:
if dat = todaysdate -10 or dat = todaysdate -9 or dat = todaysdate -8...... then
msgbox "Soon birthday be ready"
else
end if
anyone able to help me do this?
i work in access 2016
Last edited: