dbTalk Databases Forums  

Lebans textbox justification - how do you use it?

comp.databases.ms-access comp.databases.ms-access


Discuss Lebans textbox justification - how do you use it? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Thomas
 
Posts: n/a

Default Lebans textbox justification - how do you use it? - 01-04-2005 , 11:01 AM






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.

Reply With Quote
  #2  
Old   
Stephen Lebans
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-04-2005 , 01:05 PM






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.thomas57 (AT) ntlworld (DOT) com> wrote

Quote:
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.


Reply With Quote
  #3  
Old   
Mark Thomas
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-04-2005 , 03:32 PM




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!

Reply With Quote
  #4  
Old   
Mark Thomas
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-04-2005 , 03:41 PM




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!

Reply With Quote
  #5  
Old   
Mark Thomas
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-05-2005 , 12:40 PM



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!

Reply With Quote
  #6  
Old   
Stephen Lebans
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-05-2005 , 06:13 PM



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

Quote:
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!


Reply With Quote
  #7  
Old   
Mark Thomas
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-06-2005 , 03:00 PM



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!

Reply With Quote
  #8  
Old   
Stephen Lebans
 
Posts: n/a

Default Re: Lebans textbox justification - how do you use it? - 01-06-2005 , 03:54 PM



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

Quote:
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!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.