Datasheet column formatting

G

Guest

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
 
R

RoyVidar

J Welsby said:
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

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.
 

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

Top