Link to home
Start Free TrialLog in
Avatar of Michael Franz
Michael Franz

asked on

MS Access Bound Objects.

T#1 - Employee Name
T#2 - Month and Month # (Jan and 1, Feb and 2, etc..... Dec & 12)
T#3 - Calendar - Year (2010-2020)
T#3 - Shortfall - Employee Name, Month, Month#, Year, & Amount

Form #1 - Employee Name, Month, Year & Amount

My issues is I want the Month# to fill in based upon the Month selected in the form.  So when someone is in the form and they select Month, the coinciding Month# will fill in T#2

I'm a Newbie will need extra guidance.
Avatar of rodneygray
rodneygray
Flag of United States of America image

In the before update event of MonthName, execute code to set value of month
Select Case MonthName
Case "January"
    MonthNumber = 1
Case "February"
    MonthNumber = 2

....
Case Else
   msgbox("Invalid month entered. Click OK to enter a valid month.",vbyes)
   Cancel = true
   me.undo
End Select
Avatar of COACHMAN99
COACHMAN99

your field =month(month name)
Avatar of Hamed Nasr
I'm a Newbie will need extra guidance
Upload a sample database of what you have done and explain what went wrong and what you expect.
if your month field is a dropdown? (e.g. cboMonth), and your month# field is a textbox (e.g. txtMonthNum) then
on the change event of the dropdown add the following code

Private Sub cboMonth_Change()
  txtMonthNum=Month(cboMonth)
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Franz

ASKER

Thank you very much