An implementation of Visual Basic that is built into Microsoft products.
Hello @Shelby Heard ,
Since your question is a bit general and doesn't specify which software you are using (but is tagged under Visual Basic for Applications), I assume you are generating this Birthday Report using either Microsoft Access or a custom Microsoft Excel macro.
Below are the steps you could try to see if it fixes in both applications:
Scenario 1: If you are using Microsoft Access
In Access, the easiest way to add a missing column is by using the Layout View:
- Right-click your "Birthday Report" in the navigation pane and select Layout View.
- On the Ribbon under the Report Layout Design tab, click on Add Existing Fields to open the Field List pane.
- Find the
Telephonefield in the list, then simply drag and drop it onto your report (drop it right next to your existing columns). Access will automatically create a new column with the header and data properly aligned. - Switch back to Report View to see your finalized report.
(Note: If you don't see the Telephone field in the Field List, it means your report's underlying query doesn't include it. You must first open the Report's Record Source via Property Sheet, add the Telephone field to the query, and then it will appear in the Field List).
Official Microsoft Guide: Modify, edit, or change a report
Scenario 2: If you are using Microsoft Excel (via VBA Macro)
If your report is being automatically generated by an Excel VBA script, you will need to edit the code directly:
- Press
Alt + F11to open the Visual Basic Editor. - Locate the module containing the code that generates your birthday report.
- Look for the loop (usually a
FororDo Whileloop) where data is being copied to the report sheet. - Add a new line inside the loop to pull the telephone column.
The following code snippet demonstrates what that modification might look like:
For i = 2 To lastRow
' Existing code copying Name and Date of Birth
wsReport.Cells(reportRow, 1).Value = wsData.Cells(i, 1).Value
wsReport.Cells(reportRow, 2).Value = wsData.Cells(i, 2).Value
' ---> NEW LINE: Copy the Telephone number (Assuming it's in Column 3 / Column C)
wsReport.Cells(reportRow, 3).Value = wsData.Cells(i, 3).Value
reportRow = reportRow + 1
Next i
(Note: If your source "Data" sheet does not originally have a Telephone column, you must first add that column to your raw data sheet and populate it with numbers before your VBA code can pull it into the final report).
Could you please confirm which application (Access, Excel, or something else) your database is built on? If you can share a bit more detail, I'd be happy to give you more specific instructions! If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.