By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,062 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

Lebans textbox justification - how do you use it?

P: n/a
Delighted to find Lebans textbox justification but...

....after you have downloaded the sample database, with its module,
what do you do to make your own text boxes in your own database have
justified text?

I have tried copying the module out of the sample database but that,
in itself, didn't do the trick.
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Look at the source code behind the sample Reports, for example the
report named "rptClass JustifyText".

' ********START CODE
Option Compare Database
Option Explicit
Dim Justi1 As New clsJustifyText
Dim Justi2 As New clsJustifyText

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call Justi1.fRecordSection(Me, Me.txtTestmemo, PrintCount)
Call Justi2.fRecordSection(Me, Me.txtTestMemo2, PrintCount)
End Sub

Private Sub Report_Close()
Set Justi1 = Nothing
Set Justi2 = Nothing
End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
End Sub

Private Sub Report_Page()
Dim myBool As Boolean
myBool = Justi1.fJustiDirect(Me)
myBool = Justi2.fJustiDirect(Me)
'Debug.Print "SF Page event"

End Sub
' ********END CODE

You need to duplicate this code behind your own report. Make sure you go
through the user interface and select "Event Procedure" behind the
Detail section's PRINT event and the report's PAGE event.

This sample report has two TextBox controls that is justifies Text in,
named txtTestMemo and txtTestMemo2. Look at the properties for each
TextBox control.

The Font color is set to WHITE.
The ControlSource is set to the memo field named testmemo.

An alternative to all of this is to use my JustifyText ActiveX control.
The only drawback is that it does not support CanGrow/Shrink as the
JustiDirect solution does.
http://www.lebans.com/xjustifytext.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mark Thomas" <m.********@ntlworld.com> wrote in message
news:2f**************************@posting.google.c om...
Delighted to find Lebans textbox justification but...

...after you have downloaded the sample database, with its module,
what do you do to make your own text boxes in your own database have
justified text?

I have tried copying the module out of the sample database but that,
in itself, didn't do the trick.


Nov 13 '05 #2

P: n/a

Yes, that works. Especially after I changed the font to white - double
vision before that.

Your older ActiveX solution worked fine at home but wasn't so bright on
the network at work. Lost my date() function until I unchecked the
ActiveX - which wasn't on the network etc. I didn't want the textbox to
grow so that didn't bother me.

So it looks like the code will be the cleaner solution.

Thank you very much.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a

Yes, that works. Especially after I changed the font to white - double
vision before that.

Your older ActiveX solution worked fine at home but wasn't so bright on
the network at work. Lost my date() function until I unchecked the
ActiveX - which wasn't on the network etc. I didn't want the textbox to
grow so that didn't bother me.

So it looks like the code will be the cleaner solution.

Thank you very much.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

P: n/a
I spoke too soon. While the code works on my home PC it will not work
on the PC/network at work.

It halts at the call for justi1, as far as I can remember.

Any ideas why?

Is it possible that there are VB libraries that need installing or some
such thing?

Mark Thomas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

P: n/a
No, the code does not require any explicit References.

Kind of tough to diagnose the issue with the information you are
supplying.
Try running one of the report's in the sample MDB you downloaded.

FInally, ensure you have a Default printer defined for the Report.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mark Thomas" <nosp@m> wrote in message news:41**********@127.0.0.1...
I spoke too soon. While the code works on my home PC it will not work
on the PC/network at work.

It halts at the call for justi1, as far as I can remember.

Any ideas why?

Is it possible that there are VB libraries that need installing or some such thing?

Mark Thomas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #6

P: n/a
The downloaded sample doesn't work either.

However, our network technician has just installed the ActiveX on one of
our PCs so that I can now use that method.

Could the failure of the code to run be to do with DAO v ADO?

Mark Thomas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #7

P: n/a
As I stated the first time there are no DAO dependencies or any other
external libraries required.
Again I ask, what is the error message?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mark Thomas" <nosp@m> wrote in message news:41**********@127.0.0.1...
The downloaded sample doesn't work either.

However, our network technician has just installed the ActiveX on one of our PCs so that I can now use that method.

Could the failure of the code to run be to do with DAO v ADO?

Mark Thomas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.