Microsoft
Software
Hardware
Network
Question : Is it possible to store the format for the format property in a table?
Hi,
Is it possible to store the format of the MS Access format property in a table? For instance, I need to set the format of a textbox control on a form based on what county the item belongs to. For example, if the county is x, I need the format to be @@@@-@@@-@@@, if the county is y it would be @@@-@@@-@@@. It's possible that more counties could come on in the future. Is it possible to store the format in a table and reference it from code in VBA.
Table Example:
CountyID FormatType
X "@@@@-@@@-@@@"
Y "@@@-@@@-@@@"
VBA on form:
Me.txtNumber.Format = tblCounties.Type where CountyID = County
I'm hoping to avoid having to code it in VBA every time a new county comes on. Thanks for your help!
Answer : Is it possible to store the format for the format property in a table?
Yes it is rather simple however it is this dose use code
but only one line
The tables are setup as in the images
And they are linked by the county field which should be set to a prim. key. in the formatTbl table
instead of the ID
Anyway give it a try
Private Sub Detail_Paint()
string2format.Format = myFormat
End Sub
1: 2: 3:
Private Sub Detail_Paint() string2format.Format = myFormat End Sub
Open in New Window
Select All
format.jpg
(72 KB)
(File Type Details)
Format from table data
Random Solutions
TRYING TO OPEN ACCESS DATABASE THAT HAS A FRONT END MENU WHEN DOUBLE CLICK TO OPEN
Entourage 2008 users can no longer login/sync to Exchange 2007
Return Multiple Rows as Delimited List
How to access CD-ROM/Audio of Thin Client Device after login to Microsoft Terminal Server?
Run-Time Error 3155 ODBC-Time Out on a linked table.
ReOrder Priorirty
ORDER BY in UNION query that contains both text and numbers
How can I put the file name and a SHORT path at the bottom of my word 2007 documents?
How can I programmatically get a list of spreadsheets from a MS Excel workbook?
DC not responding to directory service requests