i am traying to put date from access table in text box with 2 coloumn (Invoice No &Invoice Amount)
below code gives me right allignment for both coloumns . i want field 1 i.e invoice no to be left allign and field 3 i.e invoice amt. to be right allign.

Text12.Text = Text12.Text & vbCrLf & Format$(TblInvDetRs.Fields(1), "@@@@@@@@@@") & vbTab & Format$(TblInvDetRs.Fields(3), "@@@@@@@@@@@")

Thanks

You need to look into the property pallet of the control, and refer to the property mentioned in the previous post.

Just set the alignment property of the textboxes in the property window

0 - Left Justify
1 - Right Justify
2 - Center

or in code:

Text1.Alignment = 0 'left align
Text1.Alignment = 1 'right align
Text1.Alignment = 2 'center align

there is only one text box , aligning left or right will make align both coloumn in either way.

Edited 5 Years Ago by PM312: n/a

there is only one text box , aligning left or right will make align both coloumn in either way.

A textbox does not have columns.

A textbox does not have columns.

i am trying to put text from two fields in database in one single textbox i.e invoice number and amount of invoices .which is working well with my code given at the begining.

but i want invoice details toappeare left align and amount details right align.

further this textbox forms body of email for informing supplier about payment details.how can i add screenshot to show clearly the current result and the result i want

thanks.

OK, then. Get ready:
Set the textbox to a nonproportional font.
Figure out how many characters can fit across in the box
Count the characters in both fields
Subtract that value from the number of characters the box can hold
Add that many spaces between the fields

Copy the textbox.text field into the email.

This question has already been answered. Start a new discussion instead.