Insert Empty table witn specific number of rows (1 Viewer)

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
Hello

I have one report . I use it as “ temp var “ linked to one form such That it will show only data of specific record in that form.so the report will be only one page.which I will put button to covert it to pdf format.

In the second page of report , I want to insert empty table with 5 columns . I want the number of rows in that table to be depend on value of text box entered in the form. The rows will be empty as I said Because the report will be printed and the client has to fill the rows in the table.

is it possible?
I hope you understand.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
You could try using a subreport with a record source where you can control the number of rows it returns. Just make all the textboxes unbound.
 

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
You could try using a subreport with a record source where you can control the number of rows it returns. Just make all the textboxes unbound.
Sorry but cay you explain further .
Bear in mind the number of rows will be different for each record.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
Sorry but cay you explain further .
Bear in mind the number of rows will be different for each record.
Let's say you have a table with rows of sequential number from 1 to 100. When you want to return 5 rows, your query might look something like this.

SELECT ID FROM TableName WHERE ID<=5

You can then replace the criteria with a reference to your textbox. You would then use this query as a subreport. Hope that helps...
 

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
Very good idea!!

One question , where I put this statement SELECT ID FROM TableName WHERE ID<=5 and how I replace it withvalue of the textbox.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
Very good idea!!

One question , where I put this statement SELECT ID FROM TableName WHERE ID<=5 and how I replace it withvalue of the textbox.
In the record source of your subreport. It might look something like:

SELECT * FROM TableName WHERE ID<=Forms!FormName.TextboxName
 

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
In the record source of your subreport. It might look something like:

SELECT * FROM TableName WHERE ID<=Forms!FormName.TextboxName
Thank you so much !! I think this is the best solution.

I will try it , if I face problems or had any doubts I will tell you !
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
Thank you so much !! I think this is the best solution.

I will try it , if I face problems or had any doubts I will tell you !
Hi. You're welcome. Good luck! Let us know how it goes...
 

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
Hi. You're welcome. Good luck! Let us know how it goes...
It works

but I have one problem , headers of the sub report are not showing.

see below:

table.JPG
 

sadiq92

New member
Local time
Today, 13:04
Joined
Jun 4, 2020
Messages
29
There's a setting to turn that on. Check the Properties Window of the Subreport Control.

Thank you so much , I really appreciate it ! God bless you !

One last question , how I change the background of report table to white . Because at the moment is alternating ( white & grey ).
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
Thank you so much , I really appreciate it ! God bless you !

One last question , how I change the background of report table to white . Because at the moment is alternating ( white & grey ).
I think there's a setting for that too. (e.g. Alternate Back Color = No Color)
 

Users who are viewing this thread

Top Bottom