Solved

MS Access Bound Objects.

Posted on 2016-11-17
6
66 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:Michael Franz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 85

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:Michael Franz
ID: 41893274
Thank you very much
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

724 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