Unbound textbox won't print (1 Viewer)

hardhitter06

Registered User.
Local time
Today, 05:44
Joined
Dec 21, 2006
Messages
600
I have an unbound textbox on a form that pulls a searched number from the previous form. Works perfect except it doesn't print. I've been searching around and can't find the solution.

This is part of my code from my OnClick button to open the form I am talking about above.

Forms!frmAssetDelete!Text29 = Me.Text10

I need the unbound textbox (text29) to print.

What is the secret?

Thank you,
 

Beetle

Duly Registered Boozer
Local time
Today, 03:44
Joined
Apr 30, 2011
Messages
1,808
I'm a bit lost as to your problem. Are you saying that the value appears in the text box on the second form, but it is not there when you print? What are you printing? The form itself (forms are not intended to be printed) or a report?
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Today, 02:44
Joined
May 3, 2012
Messages
636
Are you trying to print from your form? Try checking the textbox property called "Display When". It might be set to Screen Only
 

hardhitter06

Registered User.
Local time
Today, 05:44
Joined
Dec 21, 2006
Messages
600
Beetle, Yeah I'm doing a Ctrl+P to print the form...that makes sense. And Yes trying to print the value on the form which shows on the screen but not in the print out. Problem with that is I need to delete a record on this screen so the user prints the form before the delete and then after to show that it no longer exists. Right now they are writing the number on the print out themselves.

AccessMS, I have checked that and its set to Always. I did look at that first but thanks for pointing that out...i didnt notice that setting at first.
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Today, 02:44
Joined
May 3, 2012
Messages
636
Try setting unbound text controlsource = =[Text10].
 

hardhitter06

Registered User.
Local time
Today, 05:44
Joined
Dec 21, 2006
Messages
600
Sorry,

I just talked with the main person that uses this DB.

He says when he looks up a record, that number shows and prints.

When he deletes the record, the number still shows but doesn't print.

This number is not part of the record, it just shows the user what they searched on the previously form. Does this hint at something else?

Thank you
 

hardhitter06

Registered User.
Local time
Today, 05:44
Joined
Dec 21, 2006
Messages
600
I dont know how the =[Text10] would work when there is no Text10 on this form. Like I feel it would need more to know to reference Text29 from the previous form...
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Today, 02:44
Joined
May 3, 2012
Messages
636
OH.didn't realize Text10 is coming from a different form. If the user deletes the record than you no longer really have the value there - it still shows up in the screen because you haven't refreshed the form. What is the purpose of maintaining the value that they searched for?
 

hardhitter06

Registered User.
Local time
Today, 05:44
Joined
Dec 21, 2006
Messages
600
Its to make sure they typed the right number on the search because a record not exisiting and typing the number of an exisiting record wrong would bring up the same result when searched...

Like I said though the number has no reference to the record...what if I put something in the Delete "OnClick" button that would search for the record again?

Or is it because once the record is deleted the form acts in a different way? If that makes sense.
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Today, 02:44
Joined
May 3, 2012
Messages
636
How many records do you have in the system? Why don't you make the search box a combo box and bind it to a query that pulls up the record numbers. If the record number isn't there they won't be able to type it in.

Or you can have a VBA routine that first checks to see if the record exists. Use something like: if Dlookup("RecordNo","[YourTable]","RecordNo=" & [valueusertypedin]") = 0 then
msgbox("This record does not exist!")
else
'open your form
end if
 
Last edited:

Users who are viewing this thread

Top Bottom