Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding text to a unbound text box on a report 1

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
thread703-812556
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
 
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

 
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
 
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top