Use textbox value of 1 report to autofill a textbox in another report

cloudsurfer

New member
Local time
Today, 07:16
Joined
Mar 23, 2020
Messages
18
Hi all,
This must be very simple but I'm stuck for hours, googling, trying etc.
Simplistic version.
Report 1 has a list of values and at the bottom a sum of these values in a textbox (lets call it total).
Report 2 has a textbox and in this textbox, the value of total.
I've tried in properties =[Rapporten]![Total Night]![Tekst7].[Text] but this ends up with an error.
With a bit of VB knowledge I would expect I could select .[value] but in properties I can't.
Hopefully it's doable with a simple line of text instead of coding but if that's the case, that's an option too.
 
I do not think you can reference the Text property unless that control has the focus.? Trying to show that in a report gives that error?
Also I thought that held the old value.? Why not just use the control or the control.Value ?
 
Use the dirty way, fill a variable in the report_Close. Declare the variable in a module!
 
Hi Chris. Welcome to AWF!

Couldn't you calculate the same total value using an expression? Just curious...
 
Hi Chris. Welcome to AWF!

Couldn't you calculate the same total value using an expression? Just curious...
Your sum is calculated with figures from your table. Create the expression in the textbox on Report2
 
:unsure: that could be the easy answer I was looking for.
This is the query:
SELECT totaaltabel.Nighttime, totaaltabel.Type
FROM totaaltabel
WHERE (((totaaltabel.Nighttime)>0));
And then I use the query to form the report with at the bottom a text with the total using =sum(nighttime).
How will that fit in 1 expression?
 
Solved it. Forgot to setup the main Table as the source. Now the expression works.
And since that table is the main source, I should be able to get all different totals out from it with sum if.
thx !!
 
Solved it. Forgot to setup the main Table as the source. Now the expression works.
And since that table is the main source, I should be able to get all different totals out from it with sum if.
thx !!
Welcome!
 
Solved it. Forgot to setup the main Table as the source. Now the expression works.
And since that table is the main source, I should be able to get all different totals out from it with sum if.
thx !!
Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 
Sadly it's not working yet.
I do get my sum but for some reason it repeats itself many times.
I've readup on it and it's not the width of the page.
Report record source = mytable
Then in the detail section on the text box I've put =Sum([Nighttime])
But it repeats about 1968 times.
Any idea?
btw: I'm just testing, 2nd box should be empty so that's not the problem
 
Last edited:
Sadly it's not working yet.
I do get my sum but for some reason it repeats itself many times.
I've readup on it and it's not the width of the page.
Report record source = mytable
Then in the detail section on the text box I've put =Sum([Nighttime])
But it repeats about 1968 times.
Any idea?
btw: I'm just testing, 2nd box should be empty so that's not the problem
View attachment 83091
Perhaps need to set the form as single. Not continuous
 
I don't have that option in my report.
I can choose "reportview" or "print preview" in the default view section
 
I don't have that option in my report.
I can choose "reportview" or "print preview" in the default view section
My apologies. I mistook the screen shot you posted of your report as a form😱.
I can't help you further at this stage.
 
bring youir Report to design view.
select the Total textbox.
on its Property->Format->No Duplicate=Yes.
 
That helped 50% thx.
Now the info is not duplicated but the report still produces 1968 empty reports...?
 
Reports don't hold data, tables hold data. if you want to calculate values in a report, you need to base your calculations on a table or a query. If the source of the data is not in the report's RecordSource itself, you will need to use domain functions or possibly subreports to pull in the additional data.
 

Users who are viewing this thread

Back
Top Bottom