Report grid lines (1 Viewer)

Gmelsofty

Registered User.
Local time
Today, 02:29
Joined
Mar 26, 2017
Messages
20
Hi…
I wish to find out how I can draw grid lines on a report without a record source.
Thanks in advance.
 

JHB

Have been here a while
Local time
Today, 11:29
Joined
Jun 17, 2012
Messages
7,732
Do you mean show the grid lines?
Open report in design view, right click in the Detail section, choose "Grid"
 

Gmelsofty

Registered User.
Local time
Today, 02:29
Joined
Mar 26, 2017
Messages
20
I mean having grid lines coded on a report without the record source.
The grid lines should look like ms word tables where data shall be added later.
Thanks.
 

Minty

AWF VIP
Local time
Today, 10:29
Joined
Jul 26, 2013
Messages
10,378
You can't enter data into a report.
If you want an empty grid like Form to enter data in, that is normally called a datasheet view of a form.
 

JHB

Have been here a while
Local time
Today, 11:29
Joined
Jun 17, 2012
Messages
7,732
You can't, but if you explain why you want that, someone could have an alternative solution.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:29
Joined
Feb 19, 2013
Messages
16,683
if you just want a report to be able to print an empty sheet with boxes in the detail section aka word to be completed manually, try using a number of boxes all lined up horizontally and vertically as required
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:29
Joined
Feb 28, 2001
Messages
27,337
My question is this: When printing this hypothetical report, does it have ANY data at all in it, with some fields already filled in but others blank? Or is it totally blank?

Totally blank, with gridlines: Use Excel. There is a border control tool that lets you turn grid lines on or off based on a "select" box containing columns and rows. Even if you wanted a few headers or labels, these can be write-ins and the border control tool will allow you to include or exclude the labels as needed. Use the grabber tool to stretch or squeeze the columns and rows. Don't forget to use the print preview to see what it looks like so that you don't have "margin spill" (where the boxed area exceeds the margins of the print area so requires a second page.)

You can also do something similar with Word and the Table tool. Again, create a document with whatever you need in the grid as column or row headers, and Word also has border tools and the grabber to resize rows or columns.

If you are dead set on using Access, and particularly if there are values in some but not all of the fields of your grid, it is a LOT more work.

First, when you make any report, even if it is bound to a table, you can forestall seeing #ERROR or #VALUE if you make the .ControlSource for a report field be based on a formula such as

Code:
=Nz( [potentially-blank-field], "" )

This lets you define the boxes that will be empty or not. You probably should have one field in the .Recordsource for each column you were planning to draw.

Then build your report. In the detail section, you use the grabber tool to resize the unlabeled text boxes so that their edges exactly overlap. (Recommend turning on "Snap to Grid" when doing this.) You can use the Select tool to include all fields at once and set a non-trivial border using the border tool at that point. The borders of the boxes become your grid. You then drag the Detail section's top and bottom to be flush with the text boxes.

You CANNOT have labels in the detail section if you do this, with one possible exception. If you need a row of column headers, put them as labels in a separate Page Header group. If so, remember to adjust the group-section size to be flush with the labels. If you have a column of constant row headers, you can have ONE label in the detail section to express the constant row header. However, if you have variable row headers, they must be provided as DATA in your source table.

Here's the critical part: REGARDLESS of whether you have fixed or variable row headers, you must have a recordset that has the desired number of records and fields in order to drive the report output. If you have variable headers, the recordset must contain the required number of rows, one with each row-header value. If you wanted fixed headers, you need that many blank records (or you can just allow duplicates and have that many records with the values for the fixed headers.)

Note that even if this information being captured on your printed form will be fed back into a table later, there is no reason that the table driving this particular blank report is the table that will get the data in question. It can forever be a "dummy" table and "dummy" report set aside for this purpose.

The reason this is so tricky in Access is that it is designed to work with "sparse" data sets by doing NOTHING. I.e. if you build the report but had no data, you would have no report either. Without those "fake" or "empty" rows, the report will be empty and therefore will print nothing, not even the grid. So you can fake it out by building the required table to drive the report. But to be honest, Excel or Word are better at building printable grids.
 

Gmelsofty

Registered User.
Local time
Today, 02:29
Joined
Mar 26, 2017
Messages
20
Much thanks.
Would you please give me a sample database that will create grid lines like the attached file. Bearing in mind that this is a database intended to analyze students performance.
The intention of having such grid lines is to allow flexibility of adding subjects incase the school decides to to introduce a new subject.

Thanks once again.
 

Attachments

  • Grids.png
    Grids.png
    35.4 KB · Views: 515

Minty

AWF VIP
Local time
Today, 10:29
Joined
Jul 26, 2013
Messages
10,378
Your desired layout is indicative of a poorly structured table design. You don't store data "horizontally" like a spreadsheet in Access, you store it vertically then create a report to present the data in the format you desire.

There is a very apt example here - I would suggest that you have a read https://access-programmers.co.uk/forums/showthread.php?p=671226
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:29
Joined
Feb 28, 2001
Messages
27,337
I repeat... if you are capturing data here on paper, make this form with Excel.

However, Minty is absolutely correct in his statement that as shown, that data set is not properly normalized.

I understand that building a "capture" form for paper capture is very different from making a database "capture" form for data entry. From what you have shown us, and from your comments, I infer a certain lack of experience in this kind of thing. If you want to do this in Access, you need to learn about "database normalization," which is something you can find online in truly copious numbers of articles from colleges, vendors, and some folks who have posted tutorials.
 

Users who are viewing this thread

Top Bottom