Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Datasheet column formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J Welsby - 17 Nov 2006 04:14 GMT
Does anyone know how to set the format via VBA on a field (column) in a
datasheet?  The data for the datasheet is set programmatically and depending
on user selection, the field may need to formatted as a percentage or as
currency

Thought I might be able to use conditional formatting but this does not seem
to let one change this type of formatting
Thanks in advance
James
Alex Dybenko - 17 Nov 2006 06:26 GMT
Hi,
you can try to apply formatting in underlying query, just use Format()
function to set appropriate format for each record.

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Does anyone know how to set the format via VBA on a field (column) in a
> datasheet?  The data for the datasheet is set programmatically and
[quoted text clipped - 7 lines]
> Thanks in advance
> James
RoyVidar - 17 Nov 2006 07:48 GMT
"J Welsby" <JWelsby@discussions.microsoft.com> wrote in message
<F4FBA415-D3DE-4801-B79A-272BA6974489@microsoft.com>:
> Does anyone know how to set the format via VBA on a field (column) in
> a  datasheet?  The data for the datasheet is set programmatically and
[quoted text clipped - 5 lines]
> Thanks in advance
> James

Assuming you mean a datasheet form, have you tried

if <your condition> then
   me!txtNameOfControl.Format = "Percent"
else
   me!txtNameOfControl.Format = "Currency"
end if

If it works, it'll format the entire column, which is how datasheets
(and continuous forms) work, as I understand. If formatting individual
row values is the issue, I don't think you can do that with a
datasheet, but perhaps as suggested by Alex Dybenko, use the format
function in the underlying query.
query.

Signature

Roy-Vidar

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.