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:

Similar posts...

 

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

Runtime Error on assigning a ComboBox value to a control on a Form Icon
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

Insert calculated date into message Icon
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?
 

Update (Refresh) Calculated Field

Update (Refresh) Calculated Field Icon
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

Saving the value of a calculated field to a table field Icon
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.
 

sort by calculated field

sort by calculated field Icon
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
 

Naming a Calculated Field

Naming a Calculated Field Icon
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.
 

Need results of calculated field to appear in table

Need results of calculated field to appear in table Icon
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.
 

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

How to Fire VBA Code when a Calculated Textbox Changes Its Value Icon
I'm using MS Access 2003.

I have a textbox control txtAmountOutstanding whose Control Source is as follows:
=[txtActualAmount]-[txtAmountSettled]

(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
 

Why no Display Control with a Calculated Field

Why no Display Control with a Calculated Field Icon
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.
 

How do I reference a Calculated Field?

How do I reference a Calculated Field? Icon
I have a form that is a search form to filter results and open another form to display the results. Things work fine when I'm comparing entered values to columns in my table, but now I'm trying to add a little more functionality and running into trouble.

On my form that is displaying the data, I have a calculated field (a number). I want to add a search criteria that says. If calculated field is > "entered_value" Then .

What I can't figure out is how to reference the calculated field in Visual Basic. When I did dates I just referenced the column, but since this calculated field doesn't have a column (and from what I have read I should not create a column to store it), I can't figure out how to reference it