Thread: Data Types
View Single Post
  #3 (permalink)  
Old January 23rd, 2004, 01:23 PM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

What you do is not touch the table at all. If the value is null, so be it.

On the form, however, if the form is UNbound, then it's easy because you can populate the textbox with the actual amount (if not null) or you can populate the textbox with the string "N/A" if the actual amount is null. The datatype won't matter because the unbound textbox is not subject to a datatype. When it comes time to save the data back to the table, ignore the "N/A" and just let that value be null in the table.

If your form IS bound, then create an UNbound textbox and label it the same as the bound textbox with the currency amount. Make the bound textbox INvisible. Make the UNbound textbox visible. Then on the form's ON OPEN event you can put something like this, assuming that Me.txtMyAmount is the UNbound, visible textbox and Me.txtMyRealAmount is the bound, INvisible textbox, then

Me.txtMyAmount = Nz(Me.txtMyRealAmount,"N/A")

If you have currency, the visible textbox just shows it. If you don't have currency (the table value is null), the visible textbox will just show "N/A".


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote