RE:ajustar todo el texto.
Esto debe ser de algún "GuruAccess", lo implemente en mis aplicaciones y va muy bien.
Copiate está función y leete las instrucciones del final.
Saludos y ya me contarás.
Option Compare Database
Option Explicit
Public Function Justifica(lpzText, ControlText As Control, objReport As Report) As String
Dim Carac As String, Newtext As String
Dim Numspaces As Long, WidthSpace As Integer
Dim WidthControl As Integer
Dim I As Integer, Inicio As Integer
Dim LastPos As Integer, PosSpace As Integer, PoscharBreak As Integer
Dim FinalText As String, SpacesInStr As Integer
Dim SizeText As Integer
Dim POSI As Long, CI As Integer
Dim NextCarac As String
Dim n As Long
objReport.FontName = ControlText.FontName
objReport.FontSize = ControlText.FontSize
objReport.FontBold = ControlText.FontBold
objReport.FontItalic = ControlText.FontItalic
WidthControl = ControlText.WIDTH
WidthSpace = objReport.TextWidth(" ")
SizeText = Len(lpzText)
I = 1
Inicio = 1
POSI = 0
Do While I < SizeText + 1
Carac = Mid(lpzText, I, 1)
Newtext = Newtext + Carac
Select Case Carac
Case Chr(13) 'se o caracter for ENTER
FinalText = FinalText + Left(Newtext, Len(Newtext) - 1) + Chr(13) + Chr(10)
Newtext = ""
I = I + 1
LastPos = 0
Inicio = I + 1
Case " "
If objReport.TextWidth(Newtext) > WidthControl Then
Newtext = Mid(lpzText, Inicio, LastPos - Inicio)
Numspaces = Fix((WidthControl - objReport.TextWidth(Newtext)) / WidthSpace) - 1
For n = 1 To Len(Newtext)
Carac = Mid(Newtext, n, 1)
If Carac = " " Then SpacesInStr = SpacesInStr + 1
Next n
POSI = 1
CI = 1
PoscharBreak = 0
Do While CI < Numspaces
Carac = Mid(Newtext, POSI, 1)
If Carac = " " Then
NextCarac = Mid(Newtext, POSI + 1, 1)
If NextCarac <> " " Then
Newtext = Mid(Newtext, 1, POSI) + String(1, " ") + Mid(Newtext, POSI + 1)
POSI = POSI + 1
CI = CI + 1
End If
PoscharBreak = PoscharBreak + 1
If PoscharBreak = SpacesInStr Then
PoscharBreak = 0
POSI = 0
End If
End If
If POSI < (SizeText + 1) Then
POSI = POSI + 1
Else
POSI = 1
End If
Loop
FinalText = FinalText + Newtext + Chr(13) + Chr(10)
Newtext = ""
I = LastPos
LastPos = 0
Inicio = I + 1
Else
LastPos = I
End If
End Select
I = I + 1
Loop
Justifica = FinalText & Newtext
Exit_Justifica:
Exit Function
Err_Justifica:
Resume Exit_Justifica
End Function
'-2º- EN EL INFORME COLOCAR LA PROPIEDAD VISIBLE A No AL CAMPO QUE VA A SER
'JUSTIFICADO, Y LLAMARLE txtExtenso. LUEGO AÑADIR OTRO CAMPO, CON EL ORIGEN
'DE DATOS EN BLANCO, QUE VA A SER DONDE SE VA A MOSTRAR EL TEXTO JUSTIFICADO.
'LLAMARLE txtJust
'-3º- EN LA VISTA DISEÑO DEL INFORME, EN LA SECCIÓN DETALLE, AlDarFormato o
'AlImprimir (DONDE PREFIRÁIS), INTRODUCIR EL SIGUIENTE TEXTO:
'Me![txtJust] = Justifica(Me![txtExtenso], Me![txtJust], Me)
'-4º- EL TIPO DE LETRA LO TENGO PUESTO EN ARIAL 12 (¡sin negrita!) Y FUNCIONA
'CORRECTAMENTE.