cybersardinha
New member
- Local time
- Today, 21:31
- Joined
- Mar 24, 2022
- Messages
- 24
Hi,
I'm quite new to this VBA thing.
I have created this function so that I can count how many users have expired certifications. i need to check in diferent columns acording to the selection on a dropdown that declares the mFB variable.
On this code the ngultig is calculated without a problem but the gultig doesn't work.
Any Ideias of what might cause this?
Thank you
I'm quite new to this VBA thing.
I have created this function so that I can count how many users have expired certifications. i need to check in diferent columns acording to the selection on a dropdown that declares the mFB variable.
Code:
Public Function CountGultig()
mFB = "[FB_arbeitsschutz]"
dtToday = Date
expired = DateAdd("m", -12, Date)
Debug.Print expired
gultig = DCount("' & mFB & '", "database", "" & mFB & " > #" & expired & "#")
Debug.Print gultig
ngultig = DCount("' & mFB & '", "database", "[FB_arbeitsschutz] < #" & expired & "#")
Debug.Print ngultig
Text18.Value = gultig
Texto20.Value = ngultig
End Function
On this code the ngultig is calculated without a problem but the gultig doesn't work.
Any Ideias of what might cause this?
Thank you