Populate one field from another form field

Jass7869

Registered User.
Local time
Today, 07:39
Joined
Aug 12, 2014
Messages
96
How do I populate fieldA in formB with FieldB from FormA..

So Field is the last numeric field in Form A..so I need to the take the calculation value of that field and be the starting value in formB.
 
Hi
in formB field A control
=forms!"[FormA]"!"[FieldB]"
This does depend on both forms being open. The code builder will help with this.
 
Do I think the " in between?
 
Here is what I tried in the Control Source

=Nz([Forms]![Final_frm].[TotalBC1],0)
 
My field on Form A is a calculation if that helps. I have a calcualation in the control source.
 
Here is what I tried in the Control Source

=Nz([Forms]![Final_frm].[TotalBC1],0)
and what happened? did it work? if not was there an error message, it displayed 0 or what?
 
In the past I had a similar need, copying the results of a query from a field in a subform into a field on the main form. In my case I didn't want the value to be automatically copied at the beginning, the user first needs to review the information in the subform and decide if it needs to be copied or not.

Because of that, I used a command button with a VBA event to copy the relevant information. Perhaps you can do the same but set the VBA event to be On Load? If you did that you can have the default value be 0, but the On Load VBA event would override that value, if applicable.

If you want, here is a short description of what I did: http://www.access-programmers.co.uk/forums/showthread.php?t=248095
 
Last edited:
Hello,

Both my fields are on Subforms ...it's like getting your bank statement. You have a beginning balance and you have a ending balance. I want the sending balance to carry over to the next form..I have four forms total.
 
I tried =[Forms]![fsub_Final_Table Query2]![TotalBC2]. I get the same value in all my records. It's the first record in Form2..that is the Value in that field..in form3..it shows in all the records for that field
 
Hi Jass
I think I follow now.....
You do not want the value from the field in the form. This will give you the same value for all records. (there is only one active form, even if you see more than one) You need to get the information from the relevant tables (not the form). Perhaps via a query?
Without having any more details it hard to give accurate advice....sorry.
I hope this helps

T
 
if this

=[Forms]![fsub_Final_Table Query2]![TotalBC2]

is in a subform and

fsub_Final_Table Query2 is another subform on the same mainform then you need

=Parent.[fsub_Final_Table Query2].form.[TotalBC2]

where [fsub_Final_Table Query2] is the name of your subform control, not the subform which is its sourceobject

Note also, the .form. between fsub_Final_Table Query2 and TotalBC2 which is required
 
I still get an error with =[Forms].[fsub_Final_Table Query2]![TotalBC2]
this form is a subform. Both forms are subforms. Even if I put in a formula..I just hae tried all the combo for that field in that form to show up on my third form. All I am doing is taking the last field which has a calculation in that field and using that value as the starting value in my next form. My calculation is in a query.
 
Hello Spikepl,

I tried the expression builder, but the field I need is on the other form?
 
still get an error with =[Forms].[fsub_Final_Table Query2]![TotalBC2]
clearly you have not read my post correctly
 
Hello CJ,

I did try it with the parent.[fsub_Final_Table Query2].form.[TotalBC2]..

it keeps putting brackets around the parent name and the .form.

I have been trying everything
 
I tried =[Forms]![fsub_Final_Table Query2]![TotalBC2]. I get the same value in all my records. It's the first record in Form2..that is the Value in that field..in form3..it shows in all the records for that field

just looking at your text here, I don't think that you will be able to achieve this.. the forms are just looking at the current records and therefore will look to be the same for all the records in the field.
At this moment in time, I am wondering what you are achieving by this. do you need to save a calculated value? If you have two subforms with the same information on them..why?
Also, it would be nice to confirm your sub form names and also the names of the controls (not the form) that they are in. The controls may have the same name-or may not. But for us people trying to help you with the references it would help us help you.

Cheers

tim
 
Hello,

I only have four separate mainforms...all the same and each of those mainform has a subform ...the subform is based off a query. I am new to Access so for me I am still in the learning stage and if it works I don't question how it worked ..it just did.

Even my calculation field in within the query. I am stuck as I know it's one subform on a mainform.
 

Users who are viewing this thread

Back
Top Bottom