Topics Search

Assign Value to Control from Calculated Field in another Form

Assign Value to Control from Calculated Field in another Form
Views: 20
The problem -All suppliers but one supply in Litres (the other Kg). Currently if the supplier is selected in ControlB a pop up form with unbound box for Kg and another with the conversion formula. So I close the form and type the calculated value to ControlC ( assuming I can remember the number and my yptos oops typos don't get in the way
how good would it be to update controlC with a Close Button on frmConvert
Sponsored Links:

More topics


Runtime Error on assigning a ComboBox value to a control on a Form

I have this control, ctljoinEmployeeId, on my form and it is empty at the time that I want to assign a value to it.

In the add a record mode, I fill-in a combo box, cboEmployee, by choosing an employee name. In the After Update event for this combo box I assign the EmployeeName to a control, ctlEmployeeName, and all is well. Also at this point I want to assign the EmployeeId to a control, ctljoinEmployeeID. In the AfterUpdate for the for the Employee combo box the code to assign the EmployeeID is: Me.ctljoinEmployeeID = Me.cboEmployee.column(0). Both of the data types are text and the ctljoinEmployeeId is bound to a table field whilst the cboEmployee is bound to yet another table field, more correctly two fields, the name and id.

Any idea why I am getting a runtime error on this assignment or any suggestions as to how I can assign the cboEmployee.column(0) attribute to ctljoinEmployee control

Insert calculated date into message

I have a date field that caculates on click of a command button in a form. I like to use that calculated date in a message set in the body of an appointment reminder.

I want the message to read:
"Connection Date [insert connectdate from calculated field]"
Me![frmAppoints]![ApptNotes] = "Connection Date" + "" + [ConnectDate]

I've tried various combinations of double quotes and flanking the calculated field in # signs. The result is either nothing of it returns the words [ConnectDate] rather than entering the actual calculated date.

Can someone guide me on the proper way to call a field like this to return the value calculated rather and the control name?

sort by calculated field

In a report I have a calculated control which is the difference between two numbers. Is there any way that I can sort using that control? When I refer to it in VBA in an orderby it asks for the parameter of that control since it is not an actual field. Neither can I sort by it in the sorting & grouping options again because it is not an actual field

Update (Refresh) Calculated Field

I have a subform which refers values to controls on a form on which I have a calculated field -
originally I used CalculatedField Type then I changed it to txtBox with Number as Type

Control Source =[field1]+[field2]+[field3]

Now the calculated field does not show anything until all the controls have an entry. Sometimes (most times) not all will have entries. I put a form refresh on the main form but still no value.

So then I did Me.Recalc on the AfterUpdate of the Main Forms Controls Then I did Me.DelTotal.Recalc | And a refresh button in thesubform, just nothing until all the controls in DelTotal Control Source have an entry?

Saving the value of a calculated field to a table field

I have a calculated field in a form using this expression typed in the control source box =[Begin Date]+[Duration]

Since I can't bind this field to a table field I would like to transfer the value returned by this expression to a field in a table.

How to Fire VBA Code when a Calculated Textbox Changes Its Value

I'm using MS Access 2003.

I have a textbox control txtAmountOutstanding whose Control Source is as follows:

(txtAmountSettled is itself calculated from data in a subform).

I'd like to be able to programmatically insert a Settled Date into another field on the form whenever the value for txtAmountOutstanding first becomes zero.

I tried to do this by entering some code in the On Change event for txtAmountOutstanding, but apparently this event does not fire as a calculated field

Naming a Calculated Field

The Control Source for a calculated field on a report is =SUM(expresson). Can you apply a name to the field (like you would in a query) and use that name in another field?

I see that there is a Name property for the object, but I have not been able to use it for additional calculations.

Why no Display Control with a Calculated Field

As per title. This does not seem to be possible, unless Display Control can be called in SQL code? I doubt it, but maybe.

This really annoys me. I want a check box to come up for my CALCULATED FIELD in my Table, and especially in my Query. Yes my caculated field will deliver True or False.

There's nothing like a ticked box to jump out at you. Much better than a solid block of Yes/No.

Need results of calculated field to appear in table

This question concerns a calculated field on frmNCC. they wanted this form as part in Access instead of in Excel where it belongs. So I slaved over the myriad calculations and came up with a beautiful, perfectly functioning form.

UNTIL. I remembered that I need to be have that total field [TotalNCost] in tblNCC because it needs to bedownloaded into a spreadsheet.

Assumptions and attempts: I assume I need to create a field in tblNCC called TotalNCost and make that the control source for this field. And I tried that. I then moved the calculation into the AfterUpdate of the form.

This caused conflict with the Me.Recalc expressions. I tried deleting the Me.Recalcs and the form ceased to function.

ACCESS 2007 Calculated primary field

I've set up a simple database for some survey work. Data tables are linked by a primary key consisting of a 10 to 12 digit location code (picked up from a drop-down list) and a 2 digit survey number - all stored as text. Rather than use compound relationships I would like to combine these into a single primary key.

I know calculated fields in tables are wicked..! but how can do I do this automatically in ACCESS 2007. I can combine the two easilly in a calculated control in a form.. but not directly into the primary field. Although the result does appear in the control - I get an error message telling me I can't have a null entry in the primary field....