To load some data into an Access report, I use the following VBA code:
Private Sub Report_Load()
Call Acceso_Informacion
Dim basica As DAO.Database
Dim tabla_ejemplo As DAO.Recordset
Dim Texto As String
Set basica = CurrentDb
Set tabla_ejemplo = optica.OpenRecordset("Principal_Tabla", dbOpenSnapshot)
tabla_ejemplo.MoveFirst
Texto = tabla_ejemplo.Fields(2).Value
Texto1.Value = Texto
End Sub
The idea is to fill a Textbox with data from an Access table. In principle the method works. The use of embedded macros is avoided and everything is fixed in code. But there is a problem that I can not easily fix. The size of the TextBox must be variable so that, depending on the size of the text to be put there, it becomes more or less large. Thus, if this is the case, the textbox may occupy several pages, or only a few lines.
How could this be done? Is there any way to lengthen both the textbox and the length of the text so that everything appears clear and legible in the report?
Thanks in advance!