List Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to right justify a field in a listbox. I have a field that is
a number , standard , 2 decimals and it looks awkward with being left
justified.

Here is the code for the listbox: It is the Amount field I am working with.

[Forms]![frmAddInvoice]![lbInvoice].RowSource = "SELECT DISTINCTROW
[qBatchAPInvSel2].[VendorId], [qBatchAPInvSel2].[InvNum],
Len([qBatchAPInvSel2].[Amount]) , [qBatchAPInvSel2].[Order] FROM
[qBatchAPInvSel2];"

Thank you for your help.

Steven
 
Hi Doug,
I think this solution is more appropriate:
http://www.lebans.com/justicombo.htm
New Ver 2.1 Justification.zip is a database containing functions to center
and right justify data for List and Combo Boxes.

Major changes for Version 2.1 are:
Use standard API's instead of functions exposed in Access EXE.

Handle Multiple Columns

One Function for both Center and Right Alignment

Support for controls on SubForms

Huge increase in function execution speed

Clean code with comments


New CboRowSeperator.zip is a database containing a functions to display non
selectable Row dividers in a Combo.

My personal thanks to Terry Kreft for his input and assistance with this
upgrade.



Name: Dan Rock

Comments:

Hi,

Just a little addition to your justification.zip

I wanted to show the right justified column in standard number format so i
replaced the below line and it works great!

Thank you much for your contributions to the programming community.

'let's trim the string - better safe than sorry :-)

' strText = Trim$(strText)

strText = Trim$(Format(strText, "###,###.00"))


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Douglas J Steele said:
See whether what Stephen Lebans has at
http://www.lebans.com/customlistboxver3.htm helps.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steven said:
Is there a way to right justify a field in a listbox. I have a field
that is
a number , standard , 2 decimals and it looks awkward with being left
justified.

Here is the code for the listbox: It is the Amount field I am working with.

[Forms]![frmAddInvoice]![lbInvoice].RowSource = "SELECT DISTINCTROW
[qBatchAPInvSel2].[VendorId], [qBatchAPInvSel2].[InvNum],
Len([qBatchAPInvSel2].[Amount]) , [qBatchAPInvSel2].[Order] FROM
[qBatchAPInvSel2];"

Thank you for your help.

Steven
 
Now how was I supposed to know that from your TOC? <g>

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Stephen Lebans said:
Hi Doug,
I think this solution is more appropriate:
http://www.lebans.com/justicombo.htm
New Ver 2.1 Justification.zip is a database containing functions to center
and right justify data for List and Combo Boxes.

Major changes for Version 2.1 are:
Use standard API's instead of functions exposed in Access EXE.

Handle Multiple Columns

One Function for both Center and Right Alignment

Support for controls on SubForms

Huge increase in function execution speed

Clean code with comments


New CboRowSeperator.zip is a database containing a functions to display
non selectable Row dividers in a Combo.

My personal thanks to Terry Kreft for his input and assistance with this
upgrade.



Name: Dan Rock

Comments:

Hi,

Just a little addition to your justification.zip

I wanted to show the right justified column in standard number format so i
replaced the below line and it works great!

Thank you much for your contributions to the programming community.

'let's trim the string - better safe than sorry :-)

' strText = Trim$(strText)

strText = Trim$(Format(strText, "###,###.00"))


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Douglas J Steele said:
See whether what Stephen Lebans has at
http://www.lebans.com/customlistboxver3.htm helps.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steven said:
Is there a way to right justify a field in a listbox. I have a field
that is
a number , standard , 2 decimals and it looks awkward with being left
justified.

Here is the code for the listbox: It is the Amount field I am working with.

[Forms]![frmAddInvoice]![lbInvoice].RowSource = "SELECT DISTINCTROW
[qBatchAPInvSel2].[VendorId], [qBatchAPInvSel2].[InvNum],
Len([qBatchAPInvSel2].[Amount]) , [qBatchAPInvSel2].[Order] FROM
[qBatchAPInvSel2];"

Thank you for your help.

Steven
 
You're absolutely right Doug. I've been meaning to hire someone to work on
my Web site for a long time...time to start looking again.
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Douglas J. Steele said:
Now how was I supposed to know that from your TOC? <g>

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Stephen Lebans said:
Hi Doug,
I think this solution is more appropriate:
http://www.lebans.com/justicombo.htm
New Ver 2.1 Justification.zip is a database containing functions to
center and right justify data for List and Combo Boxes.

Major changes for Version 2.1 are:
Use standard API's instead of functions exposed in Access EXE.

Handle Multiple Columns

One Function for both Center and Right Alignment

Support for controls on SubForms

Huge increase in function execution speed

Clean code with comments


New CboRowSeperator.zip is a database containing a functions to display
non selectable Row dividers in a Combo.

My personal thanks to Terry Kreft for his input and assistance with this
upgrade.



Name: Dan Rock

Comments:

Hi,

Just a little addition to your justification.zip

I wanted to show the right justified column in standard number format so
i replaced the below line and it works great!

Thank you much for your contributions to the programming community.

'let's trim the string - better safe than sorry :-)

' strText = Trim$(strText)

strText = Trim$(Format(strText, "###,###.00"))


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Douglas J Steele said:
See whether what Stephen Lebans has at
http://www.lebans.com/customlistboxver3.htm helps.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Is there a way to right justify a field in a listbox. I have a field
that
is
a number , standard , 2 decimals and it looks awkward with being left
justified.

Here is the code for the listbox: It is the Amount field I am working
with.

[Forms]![frmAddInvoice]![lbInvoice].RowSource = "SELECT DISTINCTROW
[qBatchAPInvSel2].[VendorId], [qBatchAPInvSel2].[InvNum],
Len([qBatchAPInvSel2].[Amount]) , [qBatchAPInvSel2].[Order] FROM
[qBatchAPInvSel2];"

Thank you for your help.

Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top