Subform Question 02-25-08

I have an unbound form that has 12 subforms (one subform for each month) on 
it. I have a combo box on my main form that I use to select the year. When a 
specific year is selected then the 12 subforms show my record totals for each 
month. On my main form footer I have a text box that sums up all the totals 
for each month. The problem I'm having is when I select a year and I only 
have data for lets say 2 months it will only show those two subforms. And 
then the sum total on my main form footer will not calculate just the 2 
months of data shown. How do I get the other subforms to show "0" as the 
default value unless there is actual data for that given month? This way the 
calculated control on my footer will show the correct value instead of 
"#Error" 
0
Utf
2/25/2008 3:04:00 AM
access 16762 articles. 3 followers. Follow

2 Replies
833 Views

Similar Articles

[PageSpeed] 36

Larry,
Have a look at
#Error when the Subform has no records, on the Access Web:
http://www.mvps.org/access/forms/frm0022.htm

Jeanette Cunningham

"Larry Salvucci" <LarrySalvucci@discussions.microsoft.com> wrote in message 
news:F5255A09-E09F-47E5-8652-29FB0F3C08BF@microsoft.com...

>I have an unbound form that has 12 subforms (one subform for each month) on
> it. I have a combo box on my main form that I use to select the year. When 
> a
> specific year is selected then the 12 subforms show my record totals for 
> each
> month. On my main form footer I have a text box that sums up all the 
> totals
> for each month. The problem I'm having is when I select a year and I only
> have data for lets say 2 months it will only show those two subforms. And
> then the sum total on my main form footer will not calculate just the 2
> months of data shown. How do I get the other subforms to show "0" as the
> default value unless there is actual data for that given month? This way 
> the
> calculated control on my footer will show the correct value instead of
> "#Error" 


0
Jeanette
2/25/2008 4:50:09 AM
Thanks Jeanette! Just what I was looking for!

"Jeanette Cunningham" wrote:

> Larry,
> Have a look at
> #Error when the Subform has no records, on the Access Web:
> http://www.mvps.org/access/forms/frm0022.htm
> 
> Jeanette Cunningham
> 
> "Larry Salvucci" <LarrySalvucci@discussions.microsoft.com> wrote in message 
> news:F5255A09-E09F-47E5-8652-29FB0F3C08BF@microsoft.com...
> 
> >I have an unbound form that has 12 subforms (one subform for each month) on
> > it. I have a combo box on my main form that I use to select the year. When 
> > a
> > specific year is selected then the 12 subforms show my record totals for 
> > each
> > month. On my main form footer I have a text box that sums up all the 
> > totals
> > for each month. The problem I'm having is when I select a year and I only
> > have data for lets say 2 months it will only show those two subforms. And
> > then the sum total on my main form footer will not calculate just the 2
> > months of data shown. How do I get the other subforms to show "0" as the
> > default value unless there is actual data for that given month? This way 
> > the
> > calculated control on my footer will show the correct value instead of
> > "#Error" 
> 
> 
> 
0
Utf
2/25/2008 5:02:01 AM
Reply:

Similar Artilces:

Footer questions
Using XL 2000 How can I (1) reference a custom footer to a cell in the speadsheet? I would like to have in Left Footer - "prepared on" and in the center footer a date which is entered in a cell in the spreadsheet. AND (2) if you create a custom footer with font formatting in one sheet of a workbook, how can you have it placed on the footer for every sheet in the workbook? many thanks Doug Hi 1. Only possible with VBA using an event procedure Before_Print 2. Select the first sheet with this footer and group all other sheets (hold down the cTRL keya while selecting the other tab...

Scrollbar Question
Does anybody know how I can set the size of the thumb of the scrollbar? I tried using SetScrollInfo with SIF_PAGE/nPage but it doesn't work. Thanks, Vincent This article might help: http://www.codeproject.com/miscctrl/scrollbar.asp?print=true Tom "Vincent YU" <anonymous@discussions.microsoft.com> wrote in message news:153b01c3a88f$e584c820$a601280a@phx.gbl... > Does anybody know how I can set the size of the thumb of > the scrollbar? I tried using SetScrollInfo with > SIF_PAGE/nPage but it doesn't work. > > Thanks, > Vincent ...

Question about freezing cells
My Excel skills aren't the best. I can do some real basic things but because I don't do a lot with Excel, I still need help. Is there a way to freeze both a row and a column at the same time? We use Excel 2000 at work to keep track of available accrued STD (short-term disability). The employees names are in the first column and the pay period is about row 6. I would like to be able to freeze the worksheet so that I can still see the employee name and the pay period date without hiding columns. (Sometimes you need to see when the employee used some of that time.) I know I can d...

subform in subform
Hi, I've got a form F and subform S1 in it. And inside S1 I've got subform S2. How do I reference a text box in S2 from VB code? thanx alek_mil Try: forms!F!S1!S2!textbox That should do the trick -- Maurice Ausum "alekm" wrote: > Hi, > I've got a form F and subform S1 in it. And inside S1 I've got subform S2. > How do I reference a text box in S2 from VB code? > thanx > > alek_mil You might find this useful as well... http://mvps.org/access/forms/frm0031.htm -- Jack Leach www.tristatemachine.com &q...

How To Stop Acces From Update The Record When The Subform Query Is On Focus?
Hi I need to know how to stop acces from update the record when the subform query is on focus? Thanks In news:1177155216.699820.268130@d57g2000hsg.googlegroups.com, Chipcom <bz1977@gmail.com> wrote: > > I need to know how to stop acces from update the record when the > subform query is on focus? If you mean that you want to keep the main form's record from being saved when the subform gets the focus, the only ways you can do that are: 1. Have the main form be unbound. In that case your own code has to do the job of reading the record, assigning its field values to ...

Questions
I have a spreadsheet set up with pricing from vendors. Here is my goal to achieve if possible but I am not sure since I just know the basics. Example: (this is how I have it setup now) Description Date Price Widget A 9/25/05 $0.04 Widget B 8/20/05 $0.75 Widget C 9/25/05 $0.15 Example: (this is how I want it to look after the fact) Description Date Price Last Date Old Price Change % Change Widget A 9/30/05 $0.06 9/25/05 $0.04 +$0.02 +50.0% Widget B 9/30/05 $0.75 8/20/05 - ...

On Line bill pay question
I am a recent changover from Quicken and getting very frustrated. I am use to in quicken going to an online section to pay bills where only the online payees(not everyone which has ever been paid) come up and once you save a transaction you do not have to submit each bill for payment each time. In Money if you save draft, you go back two pages and have to go through menus to continue online paying. Any suggestions short of going back to Quicken? Thanks ...

selectNodes question
Hi, I am trying to get nodes (in a VC++ application) using the method IXMLDOMElementPtr::selectNodes. This is part of my XML file: <None-Books> <Summary Books="34" TopContainer="13" Client="27"/> <AAA-1 Type="0" DockingCX="200" DockingCY="120" Title="a"/> <AAA-ar Type="0" DockingCX="138" DockingCY="154" Title="b"/> <Book-3 Type="0" DockingCX="365" DockingCY="120" Title="c"/> <AAA-4 Type="0"...

Query Question
Please see the sql code below. What I am after is Sum of [RiskCount]. But due to the join, I get double counting and consequently wrong SUM. Is this an inherent limitaion of Sql? Can be it solved without breaking up the sql into two parts? Thanks for reading this post. CREATE TABLE #Location ( LocationID INT, RiskCount INT) CREATE TABLE #Coverage ( LocationID INT, Peril VARCHAR(10), Coverage VARCHAR(10), TSI Numeric(25,6)) INSERT INTO #Location VALUES (1,1) INSERT INTO #Location VALUES (2,1) INSERT INTO #Location VALUES (3,1) INSERT...

Textbox Information to Subform
I have a subform that I need to contain information from a main form. The sub form is linked by studentID, but I also need the tardy ID, TardyID, to populate the subDhall field txtTardyID. I tried the AfterUpdate of TardyID with this: Me!subDhall.txtTardyID=Me!frmTardyAdd.TardyID and Me!subDhall.frmTardyAdd.txtTardyID=Me!frmTardyAdd.TardyID to no avail. Anyone have any tips? -- Thanks As Always Rip "Ripper" <Ripper@discussions.microsoft.com> wrote in message news:753FE132-F478-4952-ABEE-EA884BB75A19@microsoft.com... >I have a subform that I need to contain informat...

Subform of a subform?
Is there a way to create a two subforms (sub1 and sub2) on one main form, but have the second subform (sub2) actually be a subform of the first (sub1)? ...

Layaway when upgrade from QS200 question.
I have just upgraded QS2000 to RMS. I am able to bring up the list of layaways in progress and see payments, balance due etc. but when I go to apply a payment on an 'old layaway' that was created in QS2000, it will only allow me to make a payment on a single item in a layaway of multiple items. For example, I choose the customer acct, then recall a layaway. This brings a list of multiple items in a single layaway, each with its own line and layaway number. I am unable to select multiple lines to process payment as a single layaway. Any thoughts on how to fix this? I have created...

Question about overridden CListBox
Hi, This is really a general query, as I got the list box to do what I want. I'm just wondering can somebody who knows the innards of MFC fill in some background. I wanted to make a CListBox that cancels the (single) selection when you click it again. It seems you have to derive a new class, but it seems to work nicely when I do this and over-ride OnLButtonUp() as follows: void ClickyListBox::OnLButtonUp( UINT nFlags, CPoint point ) { static int lastItem = -1; BOOL bOutside; int nItem = ItemFromPoint( point, bOutside ); if ( ! bOutside ) { if ( nItem == lastItem ) { ...

Question about Microsoft Money Essentials
I just downloaded the trial version of Microsoft Money Essentials and uploaded 5 different accounts (2 savings, 2 checking & 1 credit). The issue I'm having is with the pie chart report on the home page. We use our credit card for most purchases and pay it off every month to get the reward points. Because of that I categorized all our credit card purchases to properly show us the percentages we spend on what each month. But then in my checking account (which I use to pay the credit card off) I categorized the credit card payments as "Credit Card Payments/Transfers"...

Advanced Find Question 11-13-07
Is there any way to remove entities from the Advanced Find Query / Window? I would like to remove them as possible entities to "search" against. Thanks in advance, Hi, That is not possible. I assume if some user dont have read rights on some entity then it will not appear in Advance Find. -- PLEASE do click on Yes or No button if this post is helpful or not for our feedback. uMar Khan :: Freelance Consultant My Email :: imumar at gmail dot com My Blog :: http://umarkhan.wordpress.com "CPW" wrote: > Is there any way to remove entities from the Advanced Find Que...

a print question
Hello all,I meet a question in my project. I have create many diffrent dc in the project,in every dc,i use many own-draw controls in it,I want to put the dc to bmp file,how can i do? only change the map to the screen and copy the screen to a bmp file ? is there anyone give me a good idea?thanks~~~~ Hi Joseph, Is the essay you mentioned titled "A Class for saving DC contexts"? I couldn't find an essay that describes doing window snapshots? Thank you. Joseph M. Newcomer wrote: > I'm not sure why you need to create many different DCs. Most applications create exactly &...

Outlook 2003 Question #7
I am using Outlook 2003. In my Hotmail account, I have a folder where I keep some standard ZIP archives that I have emailed to myself, as code samples that I FWD to my students. But I don't want to see the grouping separators: "Today", "Last Week", Last Month", etc. Is there any way to turn that behavior off for a given folder? -- Peace & happy computing, Mike Labosh, MCSD MCT Owner, vbSensei.Com "Escriba coda ergo sum." -- vbSensei To turn off that view, deselect Show in Groups in View>Arrange by. "Mike Labosh" wrote: >...

Subform with Macro
I have a form (frm_BinDetails), within this form I have a subform (frm_Cable). frm_Cable has a listbox (List23) which when the user clicks on an entry the contents of the first column of that listbox are displayed in a textbox (txt_ProcessID). The on click event of the listbox runs a macro with the following code Action = SetValue Item = [Forms]![frm_Cable]![txt_ProcessID] Expression = [Forms]![frm_Cable]![List23] When I run the form frm_Cable on its own the macro works correctly but when I try and run from frm_BinDetails then whenever I click on an entry an error message appears saying th...

select into question
MS SQL 2000 I know I can do this: SELECT FirstName, LastName INTO #Names FROM CustNames and I know I can do this: INSERT INTO #Names EXEC dbo.MyProc '02/05/2009', 0 (where #Names has been previously defined) But can I do this? SELECT FirstName, LastName INTO #Names EXEC dbo.MyProc '02/05/2009', 0 I want to select the return values of a procedure into a new table that I haven't previously defined. Thanks, Keith AFAIK that is not possible. It might have something to do with the fact that stored procedures are not deterministic. The ret...

Report Writer Question
Hello. In GP8 , is it possible to create a calculated field in report writer w/ several levels? Something like this: IF Field A = 1 THEN "Red" ELSE IF Field A = 2 THEN "Blue" ELSE IF Field A = 3 THEN "Green" ELSE "" If I cannot do this, I am thinking I will have to create 3 fields (one for each condition) and stack them one on top of the other on the form and 'hide if empty' .. not very pretty .. Any suggestions? Thank you, Maria. You will have to use multiple fields, but you do not have to stack them one another Calc1...

Format Question
I feel silly asking this because I know it should be easy, but I just can't figure this out. I have an Excel Spreadsheet and the data is in General format and displays with one decimal and with the percent sign like this: 85.1% or 96.3%. I need to use this data in calculations so I need it to be a number format as 85.1 or 96.3...with no percent sign. I can I accomplish this. I have hundreds of rows of data that I need reformated in this way. Thanks for your help. 85.1% is the same number as 0.851 If you really need 85.1 in your calculation, you can multiply that cell...

opening a subform to a specific record?
Hey y'all, I've got a form that lists all the Students in a class and a link to "Edit Student Information" which opens a form to edit individual records. The link uses the same type of code generated by the form wizard and it automatically filters the records to the class. The next thing I want to do is to open the new form to exactly the record that was highlighted in the list. I can capture the list position from the subform (SelTop) and I found a method called "GoToRecord" that works like this to go to the 8th record: DoCmd.GoToRecord acDataForm, "Studen...

Get Subform Data
I'm looking for a way to get the data from a chosen record in a continuous subform. I have a customer form and a continuous subform with all of the charges associated with the customer. Is it possible to have a button on the form, prompt the user to highlight a record (the charge info.) in the continuous subform and get the information about the charge? If there is not a way to do this, I'm pretty sure that I can achieve what I want to do via a list box. Open the subform in design view, and set its Record Selectors property to Yes. (This is a property of the Form, not o...

Printing a single record from a tab control subform
Hi I have created a Case Management Database of students. It consists of a main form and a subform. The main form consists of information that must be seen at all times. since it consists of information about each student. The subform consists of a tab control. There is a different subject on each page of the tab contol, e.g. General Information, Current Student Information, etc. I need to print out the mainform and subforms so I created reports for each subform in my tab control. I want to put a "Print" button on each page of my tabcontrol so that when cl...

Code to duplicate data from one subform to two other subforms
This is my first database so I hope I am able to talk the language well enough to get help. I have a form with three subforms. The 1st subform is titled Service Record subform and has fields for Department, Job Title, Date In, Date Out, and Time Served. The 2nd and 3rd subforms are Department Service and Job Title Service. I would like to be able to enter an employee's information in the 1st subform and have it populate the 2nd and 3rd subforms. I am wanting the Department Name along with time served to populate the 2nd subform and the Job Title Name and time served populate th...