Adding comments to report

tezread

Registered User.
Local time
Today, 11:03
Joined
Jan 26, 2010
Messages
330
Is there a straightforward way of being able to preview reports, add comments and then be able to save the report (In snap shot format) with those comments showing?
 
how would I do that?
 
Let me illustrate my situ a bit more clearly

The report is run from a cross tab query that contains start/enter date parameters. What I have done so far is

a) created a subform based on the cross tab query
B) create a table simply called 'comments' with a single field 'comment' (memo)


But when I launch the form - I can see my results but when trying to add comments I get a message in the bottom left pane saying form is read only
 
Last edited:
how would I do that?

Crosstabs are read only, period.

If you want to add information to the crosstab you have to use subforms and what not to accomidate for it.
 
Crosstabs are read only, period.

If you want to add information to the crosstab you have to use subforms and what not to accomidate for it.
I was of this thinking as well - but how do I do it?
 
create a form to open first. Use unbound text boxes and then set the control sources of the text boxes on the report to refer to the form text boxes. Aslong as the form remains open when you open/print the report it will display that info.
 
create a form to open first. Use unbound text boxes and then set the control sources of the text boxes on the report to refer to the form text boxes. Aslong as the form remains open when you open/print the report it will display that info.

I have created a form called frm_comments. it has a text box that has no control source - which means it is not bound to anything.

Then in my report - I have created another text box whose control source is linked to the text box in the form.

I have then opened the form - typed in something and left it open. I open the report itself but nothing is displayed
 
Make sure that you move out of the text box where the text is entered or else it won't be updated.
 
ah-- if I type something and hit enter so the text is highlighted, then run the report - the text shows.

I am still wondering though- I would like it so the user can easily type comments but have the report open at the same. This works but as it stands - they need to keep toggling betwen the report preview and the form.

I tried doing a sub form based on the cross tab query of course but this didnt work out
 
I don't know if it will work but you could try adding this to the After Update event (in the VBA window) of the text box on the form:
Code:
Reports!YourReportNameHere.Requery
 
I don't know if it will work but you could try adding this to the After Update event (in the VBA window) of the text box on the form:
Code:
Reports!YourReportNameHere.Requery


I have:

Private Sub comments_AfterUpdate()
Reports!RptIncidents.Requery
End Sub


On the After update of the for text box. With the report open, when I change the text and just hit enter I get:

Runtime error 2465

Application defined or object defined error
 
Was curious so dropping on the eaves of this thread. Since I had a test db open - I checked it and the requery method works (made some field level data changes) except when you add the reference from the report control (Forms!frm!cnt) to the form control to update the comments field.

-dK
 
Yeah, I didn't think that would work. What you need to do in the After Update event is to close the report and reopen it. But you can do so without it looking like it is happening.

Code:
Private Sub comments_AfterUpdate()
   [B]Application.Echo False[/B]
      DoCmd.Close acReport "RptIncidents", acSaveNo
      DoCmd.OpenReport "RptIncidents", acViewPreview
   [B]Application.Echo True[/B]
End Sub
 
Needed a comma here ...

DoCmd.Close acReport, "RptIncidents", acSaveNo

Anyhow, I jumped in here thinking of some possibilities where this could be used for myself.

-dK
 
This works guys thankyou!

Just knit picking now - is it possible to force the form window to be open alongside the report window so they are side by side?
 
I do not get it - Last night I tried this on a past version of the database and it worked. Today at work - I have replicated the process but it doesn't work.

To clarify my steps I have

a) Built a form with a text box that is unbound - its names is Text0
b) In the AfterUpdate property of the form I have added:

Option Compare Database
Private Sub Form_AfterUpdate()
Application.Echo False
DoCmd.Close acReport, "cardiology_admittodisc", acSaveNo
DoCmd.OpenReport "cardiology_admittodisc", acViewPreview
Application.Echo True
End Sub



c) In the report I have added a text box who control source is =[Forms]![frm_comments]![Text0]


Now when I run the report and open the comments form - I can add comments into the form but I have to keep running the report to have the notes update
 
This works guys thankyou!

Just knit picking now - is it possible to force the form window to be open alongside the report window so they are side by side?

You can use the DoCmd.MoveSize function to set the parameters of the position.

-dK
 
Yes, as dkinley mentions it is the After Update of the CONTROL not the form that this should be in. I think if you go back to my original post on this you will see that I said that:
boblarson said:
...try adding this to the After Update event (in the VBA window) of the text box on the form...
 

Users who are viewing this thread

Back
Top Bottom