troubleshooting Question

Need to determine if a new quarter has started and check another table for validation

Avatar of Fordraiders
FordraidersFlag for United States of America asked on
Microsoft AccessVBA
5 Comments1 Solution49 ViewsLast Modified:
Need to determine if a new quarter has started and check another table for validation

I have a form with a dropdown of names.
After i choose a name i need to perform a Date/quarter calculation.
and compare a value in another table.

quarter_table
fields:
id-autonumber
associate_name - text
q1 - text default  =  no
q2 - text default  =  no
q3 - text default  =  no
q4   - text default  =  no

So after a name has been chosen
What I need:
I need a function to check the Current date(todays date)  and tell me the current quarter, q1,q2,q3,q4

If it is say "april 6th 2020"...the value to return would be "Q2"
Next:
so then i need to check the table "quarter_table" for that person. Look at the Column q2 and see if the entry is  "NO"
if it is
need a message box to display  "q2 = no"


I have a textbox on the form to tell me what
  quarter it is:
Private Sub Text97_GotFocus()
Dim str As String
str = Format(Now, "q")

With Me.Text97
.Locked = False
If str = "1" Then
     Me.Text97.Text = "Q1"
  End If  

If str = "2" Then
     Me.Text97.Text = "Q2"
  End If

If str = "3" Then
     Me.Text97.Text = "Q3"
  End If

If str = "4" Then
     Me.Text97.Text = "Q4"
  End If



.Locked = True
End With
End Sub




Thanks
fordraiders
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros