INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Adding text to a unbound text box on a report

Adding text to a unbound text box on a report

(OP)
thread703-812556: Editable fields on a report
I found some code that lets you add text to a text box and have it display on the report in report view.

CODE

Option Explicit
Dim SaveTyping as String

Private sub text1_keyup(KeyCode as Integer, Shift as Integer)
SaveTyping = Me.text1.Text
end Sub

Private sub text1_lostfocus()
Me.text1 = SaveTyping
end sub 
This works great but if you put it in the details section, it shows for each record and if you put if on a group level, it's the same information for each group.
Any ideas on how I could have it different for each group or detail?
My report is broken down by
GH1 - Login Date
GH2 - Emp Name
Details - Field1 field2 field3 field4 Total of Fields 1-3.

What I would like to do is for each day, have an textbox that allows you to enter notes for each day for each employee. So if their count is 0 for that day, you could add snow day or sick day or something that would print with the report.
lhuffst

RE: Adding text to a unbound text box on a report

I would create a table to store the text and then add the table to your report's record source.

Duane
Hook'D on Access
MS Access MVP

RE: Adding text to a unbound text box on a report

(OP)
Sorry for delay in answering.
I created a table

CODE

tblReportNotes
LoginId    Auto
UserID     Number
UserName   Text
LoginDate  Date/Time
Note       text


The report form has 
GH1 - Login Date
 GH2 - Emp Name
 Details - Field1 field2 field3 field4 Total of Fields 1-3. 

Since this is on a report, how would I get the data from the box into the table?
I was going to put a text box on the detail level.

Thanks
Lhuffst

RE: Adding text to a unbound text box on a report

You could create a subreport based on tblReportNotes, add it to the report, and set the Link Master/Child properties to the user and date fields. If the combined user and date fields are always unique, you could add tblReportNotes to the report's record source using a LEFT or RIGHT JOIN to include records where there are no notes.

Duane
Hook'D on Access
MS Access MVP

RE: Adding text to a unbound text box on a report

(OP)
I tried the 2nd approach and while the report does display as expected, when I try to add the note, it tells me that the report is read only.
I looked for a property to allow edits but don't see one. Any suggestions? I also added this code to the note field (code I found on this site)

CODE

Option Compare Database
Dim SaveTyping As String


Private Sub Note_KeyUp(KeyCode As Integer, Shift As Integer)
SaveTyping = Me.Note.Text
End Sub

Private Sub Note_LostFocus()
Me.Note = SaveTyping
End Sub 
Thanks

RE: Adding text to a unbound text box on a report

You are supposed to add the notes prior to running the report.

Duane
Hook'D on Access
MS Access MVP

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close