from sub form to main form

Hope someone can help on this.

I have an a form with a sub form and I’m trying to get some calculated
results
From my sub to show up in my main form.

The Main Form is Job_Sheet_2  

The Sub Form is work_hours_sub

On the sub I have the following fields that are populated from a query. The
criteria for the query comes from a combo box on the main form.   

JobID
EmployeeID
StopDate
HundredTime

The following are field that I added
Labor_charge            { Fixed Value}
Extended                  { =[Labor_Charge]*[hundredtime}

In the footer of my Sub I have the following

Text12                       { =Sum([extended]) }

On my main form I have a text box that I would like to see the results of
sub text12
fill in.

text154    {  =[Work_hours_sub].[Form]![text12]  }

The results I get in the txt154 box is  #ERROR


Any Ideas?

Gaetanm

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200705/1

0
Gaetanm
5/3/2007 9:20:29 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
1102 Views

Similar Articles

[PageSpeed] 39

Some things to check:

1. Open the main form in design view.
Right-click the edge of the subform control, and choose Properites.
Examine its Name property (Other tab of Properties box.)
You may find the Name is different from the SourceObject.
That is the name of the subform control may not be the same as the name of 
the form loaded into it. You must use its Name (not the name of its 
SourceObject) in the Control Source of Text154.

2. You have a text box in the "footer" of the subform. Is this the Page 
Footer section? Or the Form Footer? It must be in the Form Footer. The 
Control Source is right for the field described above. It may help to again 
set the Format property to Currency. Then open the subform directly (from 
the database window) and check that the total shows correctly when you have 
the form in Continuous view.

3. The subform is populated from a query. I wasn't clear if the Extended 
field was in the query, or just in the Control Source of a text box on the 
subform. If it's not in the query, add it there by typing the expression 
into a fresh column in the Field row in query design:
    Extended: [Labor_Charge] * [hundredtime]
or possibly:
    Extended: CCur(Nz(Round([Labor_Charge] * [hundredtime], 2), 0))
Then set the properties of the text box in your form to:
    Control Source    Extended
    Name                 Extended
    Format               Currency

4. If it's still not solved, try temporarily removing all other calculated 
controls on the form. This eliminates the possibility that the problem could 
be elsewhere.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Gaetanm via AccessMonster.com" <u28527@uwe> wrote in message
news:71a43112802e0@uwe...
> Hope someone can help on this.
>
> I have an a form with a sub form and I’m trying to get some calculated
> results
> From my sub to show up in my main form.
>
> The Main Form is Job_Sheet_2
>
> The Sub Form is work_hours_sub
>
> On the sub I have the following fields that are populated from a query. 
> The
> criteria for the query comes from a combo box on the main form.
>
> JobID
> EmployeeID
> StopDate
> HundredTime
>
> The following are field that I added
> Labor_charge            { Fixed Value}
> Extended                  { =[Labor_Charge]*[hundredtime}
>
> In the footer of my Sub I have the following
>
> Text12                       { =Sum([extended]) }
>
> On my main form I have a text box that I would like to see the results of
> sub text12
> fill in.
>
> text154    {  =[Work_hours_sub].[Form]![text12]  }
>
> The results I get in the txt154 box is  #ERROR
>
> Any Ideas?
>
> Gaetanm 

0
Allen
5/4/2007 4:15:28 AM
Reply:

Similar Artilces:

Forms #4
If you design a new form, in microsoft outlook can you save it as the new default form, and if yes how? ...

Delete a phantom form
Access 2000, Win XP in my Visual Basic Editor, I see a form in the upper left pane (Class Objects) which doesn't seem to exist. The form's name is ~TMPCLP423541. I presume it was a place holder for when I was copying one form to another. But it never deleted itself. I do not see it present in my forms, but I can get to it from the Visual Basic Editor (there is no associated coding, and the form is blank when brought up). How do I delete this? I tried right-click and remove, but that option is grayed out. I tried select and delete, but that doesn't do anything either. ...

populating a form based on another form
I have a sales order entry screen. Currently when a CSR is entering in a new order they will click on the new button. They then can either select the customer from the drop down list or click on the button next to the drop down to add the customer(this is the customer entry screen). Once they enter in the new customer they save and close the form. Then they will be back into the order entry screen and they will have to select the customer they just entered. What I would like is to be able to open up the customer entry form, if it's a new customer or pre-existing, find that customer and be ...

Shared Sub-calendar/sub-inbox
Hi, In Outlook 2002, users can create more than 1 folder in the main folders. Therefore user can have more than 1 calendar, inbox, task, etc... The problem is that how can you share those folders besides the main ones. I have tried different method to share out my sub contacts folders but other users were not able to view them from his/her computer. She/he can only see the main folders only. Can anyone tell me how to share out those subfolders that I have created so others be able to pull up on his/her end? Thanks, MT anonymous@discussions.microsoft.com wrote: > Hi, > &g...

VBA Sub to delete rows based on a Column Value
I have a workshhet named Final Short Quote. Anywhere in Column C wher the cell conatins the word Remove, I want to delete that row. How can do that -- Message posted from http://www.ExcelForum.com Hi try the following macro: Sub delete_rows() Dim lastrow As Long Dim row_index As Long Application.ScreenUpdating = False lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row For row_index = lastrow - 1 To 1 Step -1 If instr(Cells(row_index, 3).Value,"Remove")>0 then Rows(row_index).delete End If Next Application.ScreenUpdating = True End Sub -- Regards Fra...

Problem with the code, probably with Private Sub Worksheet_Calculate()
Hello everyone. I'm rather VB illiterate. Usually I compile fragments of code found somewhere on the internet and try to adopt them to my needs. I did something like that this time also. Unfortunately there is some problem. Because I haven't been able to resolve it on my own (in spite of many tries), I would like to ask you for a help. Basically I implemented a new piece of code into a macro which was used for a long time. Both pieces of the code (a new and the old one) work fine if they are separated. If I combine them into one SUB it's also OK, on one condition ho...

Sub not Function!
To make a comparison of two tests I want to put the values next to eac other on a sheet. To do that, I have two Combo Boxes with each the same 15 choises...yo have to choose two different tests. Now, I'm having a problem to make my code short: -Dim leftChoise As Integer leftChoise = Sheets("Keuze").Range("E1").Value Dim rightChoise As Integer rightChoise = Sheets("Keuze").Range("K1").Value Select Case leftChoise Case 1 PutLeftOnReport ("B7") Case 2 PutLeftOnReport ("B29") Case 3 PutLeftOnReport ("B51") Don't u...

pasted images appear as place holders in Outlook 2003 (since updating form IE6 to IE7)
Hi, Since we migrated our environment from IE6 to IE7, many users have complained about not being able to see the images they copy/paste between Outlook messages. Our environment: Win XP SP2 + Office 2003 SP2/SP3 Steps for reproducing the problem: -in Outlook 2003, double-clic a message containing an embedded image, right-click the image and select COPY -close the message,create a new message and paste in the body of the message: a place holder with a red cross is pasted instead of the image Problem does not appear if any of these conditions is met: -rollback to IE6 (we won't do th...

Problem with being diconnected form DB.
We moved GP9 from SQL2000, Server 2000 to a new server with SQL 2005, Server 2003. Every works great, but every once in a while a user seems to get disconnected from the server, almost like a timeout. We don't know if the problem is coming from GP, SQL, or Server 2003. Does anyone have any ideas what may cause this? Another application that has databases on the same server throws an error that the session has been terminated by the user logging on a second time or by the administrator. Both of these errors seem to occur when the user has been idle for a period of time and then tries...

Filter by Form limitations
I have a form with several combo boxes which are "limit to list". I have another combo box that is disabled if the value in another field doesn't meet certain criteria. When the user clicks "filter by form", they can't enter any wildcard strings into the "limit to list" combo boxes, and they can't use the disabled field at all for filtering. I would like the form to become more usable for filtering when the user clicks "filter by form" (ability to use wildcards etc). What is the best way to do this? I had a thought that I could put...

User Form Picture
Hi I'm trying to insert a small jpeg on a User Form in the bottom left hand corner - its about 6cm x 5cm - I can insert a picture within the VBA however its so damn big It takes over the entire user Form any ideas???? Any help much appreciated Cheers ------ Mully Hi From the control toolbox, select the image control and place it on your user form in the position you want it to be. Size it to the size you want and then Right click and select properties and select the picture you wish to use. Click on the PictureSizeMode property and select fmPictureSizeModeZoom. HTH Ken Hi ...

Organizational Forms Library missing
I have one Exchange 2003 server on a Windows 2000 Server. I am trying to install a custom form for IHateSpam. When I open the EForms Registry, I do not have a subfolder called Organizational Forms Library. I have to folders that were created by another admin. Is it possible that he deleted the Organizational Forms Library, and can I recreated it. The folders in the EForms Registry are; Test UM That is all I can see I logged in with a user with only Exchange Admin rights and Domain user rights. ...

search area on a form that opens another form with search results
I have a main form that contains a Search txtbox that when cmdSearch is click, opens another form that contains a list box of items. what i want to do is sort this items by whatever letter is entered in the search txtbox and when clicking a selection from the list box, go to main form and fill in the areas with the selected item from the list box...can anyone help with this issue? -- need help Each form can refer to the contents of a control on the other form. On your popup form, pull the contents from the Search textbox to sort your list. These newsgroups have lots of examples of ref...

Viewing forms content when receiving message
I am trying to setup a message form and I have gone through and created the form but when I send it out, the only data that the receiver views is the message text, none of the info entered into the form fields is there. I am obviously missing something. I would greatly appreciate any guidance. Cheers! ...

I would like to know how to set up a 'fill in the blanks' form?
I would like to set up a templet of sorts to fill in the blanks for certificates. ...

(Sub)totals
Hello everybody. I have the following problem: I have an Excel file with Column B 'Quantity' and column F 'Sector'. Now i need to count all the quantities within the same sector Sorting + AutoSum isn't an option, since the file has other calculations in it as well, that also depend on a sort. There's in my Dutch version a function 'DBSUM' and a function 'TURNTABEL.FETCH' ... these are translated terms, so I don't know if they match with English versions ... but could someone please tell me how these functions work, since i can't get them right (n...

Making sub reports invesible
I have this repot that has 3 text boxes Summer Brochure Winter Brochure Skiing Brochure Which will have -1 or 0 depending if true or false I also have 3 sub reports for each brochure How can i set it to make the a subreport invesiable if one of the brochures is false 0 Thanks Simon. I think you mean you have 3 subforms... one for each of the Brochure types. Do you mean that if SummerBrochure is False, hide the SummerBrochure subform... and the same for each of the Brochure types. In the OnFormat event of the report section that contains the brochure subforms... Su...

Print values dynamically on a form
I have a form that needs to display values from an array on the form; how do I achieve the following? If item count in array is < 20 then print Val1 Val2 Val3 Val4 Val5 Val6 and so on If items in array is > 20 then print Val1 Val2 Val3 Val4 Val5 Val6 Val7 Val8 Val9 and so on The following code works fine and prints values in two columns butI need to modified it to print in three columns if nItemsCount > 20 for i=1 to nItemsCount If i Mod 2 Then nX = nX * 25 nY = nY - 15 End If myVal.Name = "myVal&...

Form Controls vs VBA controls
I am new to VBA so just finding my feet, can anyone help me with th differences between an excel control (i.e. one from the form toolbox lets say a checkBox and a vba checkBox? From trying the two controls the I have noticed is that you canno capture the change event of the VBA checkbox in the code module, it ha to be done via the sheet (i.e. checkbox on sheet1, code goes in chang event on sheet1) the control is placed on, is this correct? What woul you do if you have three sheets with the same controls just differen data, do you really have to code the control 3 times? The excel control ho...

Print previewing sub form
Hi Is there a way to press a button on a main form to print preview one of its sub forms, with the preview showing the same data as is visible on the sub form? Thanks Regards On Aug 15, 5:02 pm, "John" <J...@nospam.infovis.co.uk> wrote: > Hi > > Is there a way to press a button on a main form to print preview one of its > sub forms, with the preview showing the same data as is visible on the sub > form? > > Thanks > > Regards you would be better off using a Report instead. Reports are for printing and summarizing. Forms are for da...

Referencing a Forms Button in a Worksheet
I have little experience with Forms controls on worksheets. I have a piece of code that should disable or enable a Forms command button on Sheets("QUOTE") depending on a value in a cell (True or False). The command buttons name is Edit_Add-In. I am getting an error saying "Unable to get the Buttons property of the Worksheets class". Any ideas? Thanks in Advance! ' fill array with all users information aryUserInfo = Range(Cells(1, "B"), Cells(1, "G")).Value ' enable/disable Edit Add-In button Error>>Sheets("QUOTE&qu...

Importing VBA form error
I am trying to import a form into Dynamics GP using Customization Maintenance --> Import. When I process the selected form, I get this error in the error log. Line 2: Class {C62A69F0-16DC-11CE-9E98-00AA00574A4F} of control frmEmail was not a loaded control class. Line 0: The file C:\Program Files\Microsoft Dynamics\GP\Data\s3qk.frm could not be loaded. Any ideas? The files required by Customization Maintenance are package (.package) files. You cannot load a VB form file directly. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobal...

Getting to the right ID on a continuous form
On a continuous subform, I have a button that opens up a simple form that allows the user to enter a note for a particular record. a field1 field2 [btn] b field1 field2 [btn] c field1 field2 [btn] . . . The problem is that if the user clicks, say, the button on the third record down (c), that opens the note for the first record in the continuous form (a). No matter which record's button the user clicks on the continuous form, it always opens to the first record's note. What I need to do, I guess, is get the ID of the record that the user is c...

Account history doesn't include sub account info
When viewing the Account history I can't seem to include the history of the sub accounts within this. Is it possible to do so - as obviously this would allow an overview of the entire account. JM, go to your parent account - history. Check the filters on top of that screen. When selecting: Include: Related Records, your problem should be solved. HTH Thank you for the reply, but unfortunately this doesn't seem to solve the problem. There are items in the history of the sub accounts, but nothing in the history of the parent account even when the filter is "Include Relate...

Filtering a Form Based on a Subform
I have a form that has all the hotels we use for our show. It has a subform for each show that we are using that hotel for. I use a dialog box for my housing director to find individual hotel records that allows her to select a show and then select a hotel (the hotel combo filters the list of hotels to only those that have records for that show). What she wants to be able to do now is to scroll through the hotels, but only those that have a record in the current show so that she can make sure the data is complete on all of them and make changes as she goes. Currently, when yo...