Solved

MS Access Bound Objects.

Posted on 2016-11-17
6
28 Views
Last Modified: 2016-11-18
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.
0
Comment
Question by:Newbi22
6 Comments
 
LVL 1

Expert Comment

by:rodneygray
ID: 41891919
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
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41892233
your field =month(month name)
0
 
LVL 30

Expert Comment

by:hnasr
ID: 41892479
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.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41892483
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
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 41892755
So when someone is in the form and they select Month, the coinciding Month# will fill in T#2
You should not store data in this manner. You should instead simply store the Date, and then use the corresponding VBA and SQL functions to format that Date as you want.

For example, to show the Month as an Integer:

Month(YourDateField)

So if YourDateField contains the value "01-01-2016", that function would return a value of 1. You could do this on a Textbox in a Form or Report, in a Query, etc.
0
 

Author Closing Comment

by:Newbi22
ID: 41893274
Thank you very much
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now