Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2005, 03:03 PM
Registered User
 
Join Date: Apr 2005
Location: Boston, MA, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access - calculate a cntrl/values from 2nd cntrl

I am trying to write a feild based on the values of a second field.

I have a tablefeild "MonthID" related to TblMonth. The tbl field is bound to a form feild combo box which displays the month but the ID is the bound column. Currently this list is forced, by the MonthID value, to sort as a fiscal year (Txt value, October-September; MonthID value, 1-12). I added the fiscal quarters manually.

I would like to use this same information (Month/MonthID) for program year quarters (Txt value, July-June; MonthID value,10,11,12,1,2,etc.).

I have tried several increasingly complex solutions - none work. Could someone help me or point me in a more productive direction?

CongoGrey

 
Old April 7th, 2005, 03:32 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Hi, CongoGrey, and welcome to P2P. I am unclear of exactly what you want to do. Can you explain further using examples? Thanks.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old April 7th, 2005, 03:50 PM
Registered User
 
Join Date: Apr 2005
Location: Boston, MA, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure.

I have created a table with a monthID field that is related to a second table containing the monthNames. A form is based on the first table using the MonthId/MonthNames as a combo box. MonthID is the bound column.

The users initial told me that they only want to sort dates by month and in fiscal year quarters (Oct to Dec = FiscalQtr1, Jan to Mar = FiscalQtr2, etc.). I have forced the sort order of months using the entry of months in the MonthTable (MonthId/Month is 1/Oct, 2/Nov, etc.) I manually entered the fiscal quarter.

However, now they also want to sort by program quarters (Jul to Sep = ProgramQtr1, Oct to Dec = ProgramQtr2, etc.).

My thoughts were to use a function or line of code which would read the MonthID field (like "IF [MonthID]="10", [ProgramQaurter]="1") and return values to the FiscalQtr and ProgramQtr Fields. I am new to coding, not very bold, and really don't know what I'm doing.

I hope that this is the additonal information that you sought.



 
Old April 8th, 2005, 06:48 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The simpliest way to approach this is to add another field into your table. You'd have your MonthID and MonthName, but also you'd add ProgramID. In that table, you number the ProgramIDs accordingly. In your forms and reports, no need for code, just read it off the table.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate values of different selectionlists vsempoux Java Basics 3 August 7th, 2008 10:25 AM
Page_Load not firing on "Cntrl + N" kulkarnimonica ASP.NET 2.0 Professional 1 March 14th, 2008 02:09 PM
How to calculate cumulative values of query fields method Access 0 July 12th, 2005 08:53 AM
calculate the values up crmpicco Classic ASP Basics 3 February 1st, 2005 10:18 AM
Calculate Business Days - MS access 97 snoopy92211 Access VBA 0 October 13th, 2004 02:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.