We help IT Professionals succeed at work.

Access lists formating

Victor Zugadi
on
131 Views
Last Modified: 2017-04-29
I have a list control in a form of my access application, i don't know how to format the integers values in the list, to avoid de decimals  i would want to render integer values with 0 décimals , any ideas ?
lis in an access form
Comment
Watch Question

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
in the RowSource for the list, wrap the field/expression in Format and then Nz in case it is not filled -- something like
Format(Nz([myField], 0), "#,###")   ' -- or "#.###" if period for thousand separator and comma for decimal place 

Open in new window

What is the Data Type?

Author

Commented:
Me.lstProduit.RowSource = "SELECT Catalogue.ID, Catalogue.Produit, Catalogue.[Prix Détail], " _
        & "Catalogue.[Prix Paquet], Categories.Categorie, Catalogue.IDCatégorie " _
        & "FROM Categories INNER JOIN Catalogue ON Categories.ID = Catalogue.IDCatégorie "
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
which fields) do you wish to Format?

Author

Commented:
Catalogue.Produit, Catalogue.[Prix Détail]

Author

Commented:
sorry Catalogue.[Prix Détail], and Catalogue.[Prix Paquet]
Remote Training and Programming
CERTIFIED EXPERT
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
NorieAnalyst Assistant
CERTIFIED EXPERT

Commented:
Why don't you create a query based on this SQL statement?

SELECT Catalogue.ID, Catalogue.Produit, Catalogue.[Prix Détail], " _
        & "Catalogue.[Prix Paquet], Categories.Categorie, Catalogue.IDCatégorie " _
        & "FROM Categories INNER JOIN Catalogue ON Categories.ID = Catalogue.IDCatégorie

You could then do the formatting in the query and use the query as the RowSource of the listbox.

Author

Commented:
bamashop2.PNG

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.