I apologize, I feel that I should be able to figure this out but I'm missing something. I've searched online and on this forum and couldn't find the answers though I think I'm not using the correct language because I think this should be a very simple answer.
I have an Access 2010 database. We have a student records table, with fields like FirstName, LastName, and DatabaseID and also fields for Permanent Address and Current Address, and a true/false field of SameAsPerm to indicate if both addresses are the same.
From a form, we have a button that opens up the report in order to print it
strReportName = "rptStudent"
strCriteria = "[DatabaseID]=" & Me![DatabaseID]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
On the report I need to check if SameAsPerm is true, then use the Permanent Address else use CurrentAddress, but when I try to reference the fields that should be there, all I get is errors.
Do I have to write code to create a recordset or a recordsetclone and then reference a field within that?? If the report has the data, I want to get to it directly. Thanks, I appreciate any help!
When I try to reference a field within the Report_Load sub I get errors
for example
ID = Me![DatabaseID] gives error saying that it can't find that field referenced within your expression
My report data source is set to SELECT Students.* FROM Students, and I'm only referencing fields within that Students table.
Am I running into problems because it's on the Load section?
What is the easiest straightforward way to read information from your table within a report? I have to think this is really straightforward and so I'm very confused as to why I can't get this to work at all.