Edit unbound Text box in Report View Possible?

harleyskater

IT Manager
Local time
Today, 14:21
Joined
Oct 29, 2007
Messages
95
I want to know if its possible in a report to put an unbound text box, or some sort of text box in a report and then edit that text box from the report view.

Reasoning behind this is, I want to be able to make random notes, not meant for the database underneath the records in the details.

So I tried making a text box underneath the records in the details part of my report and going to report view. It actually allows me to type in those unbound textboxes but when I go to the next box, it disappears.

It would be REALLY COOL! haha if access had this ability : ) does anyone know???
 
I believe I would be correct in saying that it is impossible to store data in an "unbound control".

I would suggest you create a table "tblNotes" and derive a form from this table and call this form when you want to record a note.

Alternatively there are some pop up programs that are designed for storing notes, an alternative you may like to consider .
 
Thats the thing though! I don't want to store these notes. I want to on the fly in report view just type it in. Then print : )
record1
quick note
record2
quick note

i don't want the quick note to be stored in the db
possible?
I believe I would be correct in saying that it is impossible to store data in an "unbound control".

I would suggest you create a table "tblNotes" and derive a form from this table and call this form when you want to record a note.

Alternatively there are some pop up programs that are designed for storing notes, an alternative you may like to consider .
 
Did you ever figure this out harley ?
I'm trying to do a similar thing. Tried the 'table' route also but can't get it to print on the report.
 
If you have the information stored in a table you should def bind your text box to the field in the table ; ) just make your record source the table and then add the field to the report.
But no, I didn't get anywhere on this : ) If there was a way, I'm sure someone here would of shared. Sorry :P
Did you ever figure this out harley ?
I'm trying to do a similar thing. Tried the 'table' route also but can't get it to print on the report.
 
I have tried in a separate table, linked, not linked, joined all ways, every way I can think. I can not get it to show on the report. Best I can get is #error.
I even tried relating to all records, nopie.
Have run out of ideas.
I'm sure it has something to do with the table relationship but can't think of any other way to do I haven't tried.

Any ideas out there ?
 
yes lots of them hahah. what tables are you using, I am guessing you have a quiery? if you have so many tables?? on one report.
this is my first suggestion, build a query that puts all your information into one table that you need for that form/report.
use the query as the source and then just add the fields : )

I have tried in a separate table, linked, not linked, joined all ways, every way I can think. I can not get it to show on the report. Best I can get is #error.
I even tried relating to all records, nopie.
Have run out of ideas.
I'm sure it has something to do with the table relationship but can't think of any other way to do I haven't tried.

Any ideas out there ?
 
BTDT lol

No I don't have that many tables 3 not counting this one table for the memo
My reports are based on queries.
I have tried getting this on the report thru the query
with and without the query and just putting the text box field on the report
tried not linking the table (TblRptmemo)
various ways
Closest I have come is setting the table without RI.
Then when I open the report it pops up a Parameter box.

doesn't seem like I need to associate with any records but....
It's just something simple I am missing I know
 
Last edited:
ok, apparently I can not have a table with data in a field without associating it with specific records ?
Or have it associated with ALL records ?
 
Apparently, from searching for hours on this, a 'global' comment or memo cannot be done on a report.
So, it appears I will have to try something else.
 
use a label not a TEXT BOX, then you can put anything you want in it, make it grow etc

nylabel.CAPTION is the property

--
i re-read this now

try the same idea, in the detail format event (maybe the detail print event) open an input box to capture the data, you want, then set it into the caption.

Never tried it, but it might work
 
I know this is an old post, but I believe I found the solution for anyone still needing one. You don't have to populate unbound textboxes on a report via a form or table. All you have to do is:

Option Explicit
Dim SaveTyping As String

Private Sub BOM1_KeyUp(KeyCode As Integer, Shift As Integer)
SaveTyping = Me.BOM1.Text
End Sub
Private Sub BOM1_LostFocus()
Me.BOM1 = SaveTyping
End Sub

In this example I put this code on the reports events. "BOM1" was the name of my textbox. Reports won't let you type directly into their controls, however if they are defined through code, that is just peachy. So you save what you typed to a variable, then when you tab off of the control you use the variable to define the control. Just a little back and forth, Pretty simple. :cool:
 
Thanks Mr.Ziggins! Your code worked perfectly. Whew. Thanks again!
 
No problem. Glad it helped. I might have made another adjustment to the code after I posted, its been to long and I can't remember. But if it has any issues, let me know and I will go back and peek at the project I used it in and let you know.
 
Well actually I do have a related question. I have 4 unbound boxes (week 1,2,3, &4) in my report so that the user can type in how many working days we had that week. I then want to add these text boxes together in another unbound box and include this in yet another calculation. My goal is to keep this in Access and not export to excel even though I know this would be a bit easier in Excel.

I have gotten your code to work perfectly for letting me put the values needed in the boxes. However, two problems so far;

1: When I use a formula in the control source for the grand total box, and re-open the report, a msgbox pops up asking me to input the values of the 4 boxes. So I tried to use a code which resulted in the following problem

2: Using a code, "Me.txtBusinessdaysTotal = Sum([txtbusinessdayswk1] + [txtBusinessDayswk2] + [txtBusinessdayswk3] + [txtBusinessDayswk4]) , I get an error when the total column "fills" stating Compile Error: Sub or Function not defined and it will highlight [txtBusinessDayswk4]. I have tried adding the .text to each and removing [txtBusinessDayswk4], but the error returns only it highlights [txtBusinessdayswk3].

I am not fully familar with VBA (obviously) and adding in reports is very new to me. Any help you could give would be greatly appreciated!!

Thanks!
 
I am not sure I have completely understood, however.

It sounds like you are trying to treat a report like a form. Primarily speaking, reports are for viewing and printing only. Each time you type in the values using my code, then close and open the report, the report starts from scratch and those fields will be blank again. Thats why its asking you for the values.

The code I gave was really meant for puting 1 time notes on a report before it is printed. The information isn't saved. Also keep in mind any code done in VBA cannot override a defined control source in a textbox, they have to be unbound. Another thing to metion, I dont' think reports actively calculate their controls. Only when they first open.

Ok now on to fixing your problem. If you can move your calcuations to a form and make the report values equal to that form that should do the trick. In a form you can put your formula in the control source as you were trying to do in the report.

Also why have the user input working days? There are modules out there that can calcuate that for you and gives you the option to handle holidays.

I know I jumped around a lot.......its early. If you truely want to keep it all in a report. Make sure all of those text boxes are unbound and do this with your code.

Option Explicit
Dim SaveTyping As String

Private Sub txtbusinessdayswk1_KeyUp(KeyCode As Integer, Shift As Integer)
SaveTyping = Me.txtbusinessdayswk1.Text
End Sub
Private Sub me.txtbusinessdayswk1_LostFocus()
Me.me.txtbusinessdayswk1 = SaveTyping
'*********Add this next part*******
me.txtBusinessdaysTotal = Sum(nz(me.txtbusinessdayswk1,0) + nz(me.txtBusinessDayswk2,0) + nz(me.txtBusinessdayswk3,0) + nz(me.txtBusinessDayswk4,0))
'****************************
End Sub


nz() returns a value if you haven't defined one for it yet, in other words if you have one of the values null(blank) it will use 0 instead. This way it will recalculate each time you enter one of the values. You would need to add that section of code for each textbox.

Sorry for being so scatter brained this morning, hope that helped. Let me know.
 

Users who are viewing this thread

Back
Top Bottom