Setting Table Format Property

swbrodie

Registered User.
Local time
Today, 16:03
Joined
Apr 9, 2003
Messages
18
Hello.

I have a Settings table that contains certain "settings". One of the settings is DateMask, which holds a value such as "mm/dd/yyyy". Users can use this setting to choose the format in which they display dates.

Is there a way to set a table's Format property from a macro, like you can with forms or reports? I was thinking that I could call a macro to set the Format property of the Data table to the value of the DateMask field in the Settings table. This way, the dates from the Data table would be displayed in the selected format.

If not, what would be the best way to accomplish this goal?

Thanks a bunch.
 
I'd use the Format() function and mix it with the DLookup() domain aggregate function.

e.g.

on the load event of a form:

Me.txtDateField = Format(Me.txtDateField, DLookup("[PreferredFormat]", "tblPreferredSettings", "[UserName] = "bl bla bla'")


Obviously the object names would need to be changed and you might have to store the username in a variable in order to look up their preferences.
 
I thought I might have to do it that way. I was hoping to be able to set the property on the table itself. That way, all forms and reports would automatically display the chosen format. But, this works fine, too.

Thanks, again.
 

Users who are viewing this thread

Back
Top Bottom