string field name

how do i refer to a dynamic field name please. I have fields month1, month2, 
etc and only want to print the value for the current month
Something like

=val("[month" & [monthVal] & "]")

Thanks


0
Utf
5/12/2010 12:48:01 PM
access.reports 4434 articles. 0 followers. Follow

1 Replies
998 Views

Similar Articles

[PageSpeed] 32

One method:

Don't bind the control (txtShowCurrent) to anything (set its source to blank).

In the section containing the control you should be able to use VBA to assign 
the value.

Me.txtShowCurrent = Me.Controls("Month" & Month(Date())

This solution would require you to have 12 non-visible controls on your report 
in the relevant section bound to each of the 12 month fields.

Another option might be to use the DLookup function to get the value you want 
from the report's record source.  That depends on how your query is set up.
    DLookup("Month" & Month(Date()),"SomeQueryOrTable")
This might require using the additional argument of DLookup to filter the result.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

judith wrote:
> how do i refer to a dynamic field name please. I have fields month1, month2, 
> etc and only want to print the value for the current month
> Something like
> 
> =val("[month" & [monthVal] & "]")
> 
> Thanks
> 
> 
0
John
5/12/2010 1:22:24 PM
Reply:

Similar Artilces:

Search a string in all worksheets ?
I am searching for a string say ABC in all worksheets in Excel 97. However, it seems that it only allows me to search it in the current worksheet. Is there any suggestion ? Hi Peter............ In XL2k, I just highlighted all three sheets using Right-click on one tab and choosing Select all sheets..........then did Edit > Find > and typed my search string in the window and hit "Find next" repeatedly and it cycled through all three sheets finding the string...........is that what you're wanting to do? Vaya con Dios, Chuck, CABGx3 "Peter" <anonymous@di...

Bad break field in an additional Header or Footer. Recheck.
Friends, I am trying to add a third party field in a report, with the steps provided in Integration Guide. But I got the following error. “Bad break field in an additional Header or Footer. Recheck.” This error comes in spite of removing third party field from the layout. If anyone can help regarding this, let me know. Look at the Additional Headers and Footers. If you have changed the index used or changed the additional sort, you might have an additional header or footer which is trying to break on a field no longer in the index or sort. David Musgrave [MSFT] Senior Development C...

Error: field address (column 18) has changed!
Hi, In the DoFieldExchange method i have the following line of code RFX_Binary (pFX, _T("[TEMPLATE_IMAGE]") , m_baTemp, ImageSize) Image size is defined as follows: const int ImageSize = ( 8400000 ); When i load the value into my class member variable(m_baTemp) and Call CRecordset::Update() Following trace message is shown Error: field address (column 18) has changed! Can anybody please tell me what could be the possible reasons... Thanks in Advance.. San ...

deleting a custom schema field
Hi.. Just want to confirm that the MMC plugin Deployment Manager does not provide for the deletion of custom fields/attributes. Am I right in assuming that I would have to delete this using SQL Ent Mgr. If so - can somebody please tell me which db and table to delete from Ta Chris Once you have added new fields into the CRM Schema through deployment manager you cannot remove them. note that because of a limit on SQL servers record size you can get to a point when crm will tell you that you cannot add another field so you should always question whether a field needs to be added or is s...

XmlTextReader to a xml string
I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader method? The trouble I'm having now is streaming the results to a string for output as an XML document. Also, since the XML that comes from teh query is not a complete document it's a fragment without a root element. So, any ideas about how to get his into a string? --Buddy Buddy Ackerman wrote: > I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader > method? The trouble I'm having now is streaming the results to a string for > output as an XML document. Also, ...

Limited Form Field (text) continuation page
I am using Word 2007. I have a form with a text field on it with a length limit to protect the integrity of the form. However, I have found that many times the form length is not sufficient for the information that is required. I would like to add an additional page with some header information to link to other form fields on the first page, however, I don't want to do this unless there is more information than will fit in the first form section. I have a small section of text in the corner of my form field that tells the user that an additional page can be used. I can a...

Tabbing to fields should highlight the field contents
Make tabbing to fields in ALL windows highlight the field's entire contents so an entry will replace everything there. This will greatly speed data entry. If one wants to append and not replace, a single click should allow cursor placement to do so. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I...

How can you copy selected cells when one cell contains a specified string?
Hi! I need to paste selected cells into different worksheets. The cells contain information like: date, amount, category eg: 24/08/04, 590, eggs 25/08/04, 430, cheese what I wanna do is copy date and amounts to eggs worksheet or cheese worksheet, depending on whether category is eggs or cheese. Is there a way to combine the IF function with a paste link, or something like that? Thanks a bundle in advance! Jon. Formulas return a value to the cells in which they reside. They cannot perform actions, such as copy,paste ect. what you want is possible but you didn't not provide enou...

How do I write a string in the destination element depending on what the string is in the source, using XSLT/XPath? (Like a switch statement.)
Is there something like a switch statement in XPath? What I want to do is this: In the source there is an element called "member" with either the value "0" or "1". In the destination element (also called "member") the value should be "No" or "Yes" (Where "0" corresponds to "No" and "1" to "Yes"). How do I do this? Joakim Olesen wrote: > Is there something like a switch statement in XPath? What I want to do is > this: > > In the source there is an element called "member&quo...

AutoComplete name suggesting
after restart outlook 2003 the AutoComplete name suggesting is not working. what do you mean by 'restarting' ? do you mean re-installing ? N "Eli" <anonymous@discussions.microsoft.com> wrote in message news:016b01c3cef9$2f098f00$a101280a@phx.gbl... > after restart outlook 2003 the AutoComplete name > suggesting is not working. Create a new profile. -- Russ Valentine [MVP-Outlook] "Eli" <anonymous@discussions.microsoft.com> wrote in message news:016b01c3cef9$2f098f00$a101280a@phx.gbl... > after restart outlook 2003 the AutoComplete name &g...

export including custom fields
I have created a custom field in my Outlook contacts file, but it does not appear in the "map custom fields" box when i am exporting my file. How can i get it to show up? Outlook doesn't support exporting custom fields. Quick and dirty method: 1. Put all the items from your form in one folder. 2. Use a table view to display all the data fields that you want to export to Excel. 3. Choose Edit | Select All. 4. Choose Edit | Copy. 5. Paste to Excel. Otherwise, you'd have to write custom code or use a third-party application. See http://www.outlookcode.com/d/customimpor...

'To' Field
Hi All, Is there a way of turning off the 'To' field in Outlook 2003 on new messages. I have a client who needs to make sure all outgoing messages are sent Bcc so they want to hide the 'To' field to stop any mistakes. TIA Terry ...

Linking forms field and table field .
Dear All, I have a form but i could not move to the next record and even i could n't save the records to the table. How can a table and a form fields can be linked.I'm encountering #Name error. Can anybody look out the form and advise me. Help is deeply welcome. Rgds, Aligahk06 aligahk06, >> How can a table and a form fields can be linked. A form can have, as it's RecordSource, a table, or a query Most times, it's a query. Place your cursor in your form's RecordSource textbox, and click the arrow that appears on the right. Using th...

Attachments are named untitled.bin
Hi there All of a sudden email attachments are renamed "UNTITLED.BIN" on my workstation. If I forward the email to another workstation, the attachments e.g. "MICHAEL.XLS" appears normally. Can anyone help? Thanks Michael ...

Outlook Rule
I am using Outlook 2007 and receive a lot of SPAM to my public e-mail addresses. A common factor in much of the SPAM is that it has a fake "Display Name" for the recipient (me) with a correct underlying e-mail address. Is there a way to set up an Outlook rule to filter out messages there the recipient's "Display Name" is not me? I have tried several variations on the rules "Where my name is/is not in the To box", "With specific words in the recipient's address." withour success. Thanks in advance for help with this. Joel are you using ...

How to find a text in a string without giving the position of the
My requirement are I want to find a particular text in a string with out giving the position of the text . I believe that if we use find and search we have to give the text position for the particular text. Can anyone guide me what should be the function used for getting this. Post example(s) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Sreekanth" <Sreekanth@discussions.microsoft.com> wrote in message news:B2ABF7FC-5745-4863-AA05-4EC1D61C825E@microsoft.com... > My requirement are > I want to find a particular text in...

Stringing formulas again
Hey there Roger, once again this formula thing is driving me crazy...I can visualize what I want to do but can't work out the formula...This is how I see it in my mind =IF(AI13,AW13,BI13,BW13,CJ13="N","",IF(AI13,AW13,BI13,BW13,CJ13="R","",SUM(AI13+AW13+BI13+BW13+CJ13/100)))) What do you think? Cheers David Perhaps this will help........... =IF(OR(AI13="N",AW13="N",BI13="N",BW13="N",CJ13="N",AI13="R",AW13="R",BI13="R",BW13="R",CJ13="R"),""...

SY02000 fields
What do the RESTYPE and RESID fields represent in the SY02000 (Security Restrictions) table? Hi David, RESTYPE is essentially which resource type was the user granted. The variations can be windows, reports. RESID is the resource ID specific to the resource dictionary. Each resource dictionary (.DIC) i.e. modules (including third party), has their own series resource ID's. The two fields metioned above is specific to DICTID i.e. the spefic product or modules intgerated with GP. Hope this helps! Cheers, Dennis Araullo, MACS Microsoft Certified Technology Speci...

Setting Scope of name ranges to particular worksheet
Excel 2003 - I set up one worksheet, assigned ranges and use macros to process data based on those ranges. Then I made copies within workbook with some changes not involving macros. Surprisingly I saw ranges with same name but "scope" only each particular worksheet. Great because same macros common to these worksheets process only ranges within particular worksheet they are called from. Now with some workbook improvements, ranges are becoming "workbook scope" instead of "worksheet scope". How can I restore "worksheet scopes" without ...

Data Field in Pivot Table is Non-numeric
The data field of my pivot table is non-numeric and hence it is shown as '0' when Sum or Average is selected as the summarization option. I know that there will be only a single value for each cell in the data area of the pivot table and hence do not require summarization. How do I show the value (non-numeric) instead of showing a summarization Copy of the source data and the resultant pivot table are shown below Regards R. Ven Kochi Refineries Limite Indi Source Data Sample Property Time Valu CV17 Naphtha Density 01/15/04 8:00 >.783 CV17 Na...

Named Printers #4
I want to use Named Printers for PA Purchase Order Entry. However, when I choose Project from the Task Series drop-down, nothing is showing up. What could be the problem? -Hari ------=_NextPart_0001_6AC20EE0 Content-Type: text/plain Content-Transfer-Encoding: 7bit In this list, "Project" doesn't mean Project Accounting, that is just the series. Any application/module can put themselves in this list in any location- however it would seem the perfect location for Project Accounting report. Looking at my list, this also is empty for me as well. Briefly looking a PA sourc...

Field Codes & What They Do
I've looked in Publisher's help files but can't find a chart that shows what are all the different field codes you can insert and what they do. I tried Microsoft's web site and I also tried searching with Google but didn't find a listing of field codes all in one area. Can someone point me to a resource to learn about field codes and their functions and to be able to print out a chart? Thanks, Kory After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Kory Hagler <kory_hagler@hotmail.com>... > Can someone point me to a resource to learn ...

String of strings
Is there a standard way of handling a double null terminated string with embedded null terminated strings. I've looked but can't find any examples. TIA, Gerry Murphy You have to manully put them in string, I believe you are looking for MutliSz reg string or string for shFileOperation if i am not wrong. -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I Believe this will Help" "Gerry Murphy" <gerrymurphy@rcn.com> wrote in message news:YNydnaPkJaUXCc7fRVn-uQ@rcn.net... > Is there a standard way of handling a...

How do I create rollovers for names in group photos?
I am using Front Page 2003 and wish to create tags for individual names in a group phot so when the mouse is moved over their image their name appears. Any help would be appreciated. Use hotspots in an image map. The image is the group photo. Create an image map, with every link going to javascript:; and give each hotspot area a title attribute. See http://www.rxs-enterprises.org/tests/hotspot-titles.aspx -- Ron Symonds Microsoft MVP (Expression Web) http://www.rxs-enterprises.org/fp Reply only to group - emails will be deleted unread. "Jeff K" <Jeff K@...

Make Existing Field AutoNumber or Other Options
I have a table that has an autonumber field called InventoryID. There is another field in that table that is also unique, its called LicensePlate#. The original design needed the License Plate # to be entered, but now the needs have changed and the license plate # needs to autonumber, incrementing from the existing data. Ideally I'd like to make this field be my primary key and have it autonumber, but keep the existing data. Based on what I've read I don't think this is possible, but #1 want to make sure. You should also know I could actually delete the InventoryID bec...