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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox dynamic display

Status
Not open for further replies.

axa4

Technical User
Dec 7, 2002
6
0
0
US
In my Clients table I have BulkPostagePermit field (memo) which contains 2 lines like these:
Anaheim, CA
Permit NO.40078

The whole Postage thingy on the report should look like:
___________
PRESORTED
STANDARD
U.S.POSTAGE
PAID
ANAHEIM, CA
PERMIT NO.49093
______________

Note that some of the clients have this field empty(NULL or "")
I don't want to type the whole thing - 6 lines over and over for each client because 4 top lines are always the same.

How do I insert the top part into the textbox on the report if this BulkPostagePermit is not NULL or empty.
If it is NULL - nothing should be displayed in this box.

Thank you.
 
I personally would have two fields. One for the city and one for the permit. Here is sample code to go in the report detail's On Format event procedure. It assumes that you have the two fields that I mentioned. It looks to see if the permit number field is null then stores data in a text box that I put on the report called txtBulkPermit. The vbCrLf are carriage returns that will make line breaks so it will print as you displayed above.

I hope this helps...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(permit) = False Or permit = "" Then
txtBulkPermit = "PRESORTED" & vbCrLf _
& "STANDARD" & vbCrLf & "U.S.POSTAGE" _
& vbCrLf & "PAID" & vbCrLf & address _
& vbCrLf & "PERMIT NO. " & permit
Else
txtBulkPermit = Null
End If
End Sub


ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
LonnieJohnson,
thank so much!
But
It doesn't work
The problem I have is that if I try to assign a value to the report textbox (txtBulkPermit = "abc")- Access gives me an error like:
- use of this property is not supported

Also, if I type txtBulkPermit. - dropdown list of properties/methods doesn't have Value or Text properties.
If I type then by hand - the same error.
Do I need to set some references or smthng else?
Thank you
 
Is txtBulkPermit a label or a textbox. Sounds like it's a label. If so, then you would say txgtBulkPermit.Caption = "blah blah blah"....



ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top