Getting info from another form

chuckster

Registered User.
Local time
Today, 17:11
Joined
Oct 4, 2000
Messages
52
I have quite a complicated costings forms with lots of calculations based on certain values.

I then have another data entry form which requires some of the information from the calculation form.

When the user enters information into the Data Entry form the afterupdate code writes the value to the Calcuation form. The Calculation form then works out the result and writes back the applicable result to the Data Entry Form.

This works fine accept that I can't control which record is showing in the calculation form.

I currently have a combo box on the calculation form that will go to the matching record.

I can get the text from the Data Entry form into this combo field but it won't go to the matching record until that form gets the focus.

I have an IIF fuction that does a similar thing and works because it updates straight away. How can I get that combo box code in the Calculation Form to update without giving the calculation form the focus?

OnChange or after update events don't work until the form has the focus.

Thanks for reading this Far.

Chucky
 
Thanks Jack I tried that code but couldn't get it going completely. Will keep tring but really I am so close doing it the way that I am. All i need is some code that will set focus to sub form and run the onchange event or something simliar.

I can write that value into to it and see it but the calculation form won't go to the record until I physically click the form with the mouse. If I use code to setfocus or gotocontrol I get an error "There is no field named ("the text that was transfered e.g. 501") in the current record."

Aggghhh.
 
From the main form code like this will move the focus to the field you want in the subform:

Me.SubformName.[Form]![ControlName].SetFocus

If you put your code in the On Enter event of the field in the subform the code should be triggered.
 

Users who are viewing this thread

Back
Top Bottom