Currency Symbol

A

Alex Hammerstein

Hi, I have about 20 databases that have been set up using the $ sign as the
currency symbol. This has been added within the formatting of objects
within the forms.

Is there anyway of changing these in bulk to the £ siugn rather then having
to change each one separately?

Thanks

A
 
F

fredg

Hi, I have about 20 databases that have been set up using the $ sign as the
currency symbol. This has been added within the formatting of objects
within the forms.

Is there anyway of changing these in bulk to the £ siugn rather then having
to change each one separately?

Thanks

A

You can use the following code to cycle through the forms in one
database.
Copy and Paste into a module in that database.

Public Sub DollarsToPounds()
' Change the Format property on all controls in all forms
' from $ to £

Dim db As DAO.Database, doc As DAO.Document, ctl As Control
Set db = CurrentDb

On Error GoTo Err_Handler

For Each doc In db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
For Each ctl In Forms(doc.Name)
If TypeOf ctl Is TextBox Then
' Debug.Print doc.Name
' Debug.Print ctl.Name
' Debug.Print ctl.Properties("Format")

ctl.Properties("Format").Value =
Replace(ctl.Properties("Format").Value, "$", "£")

' Debug.Print ctl.Properties("Format")
End If
Next ctl

DoCmd.Close acForm, doc.Name, acSaveYes

Next doc

Exit_DollarsToPounds:
Set db = Nothing
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbNewLine & Err.Description
Resume Exit_DollarsToPounds

End Sub

Watch out for word wrap on the longer lines.
 

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