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.