Hello
I'm creating a form in Access 2003 and would like to hid the 0's shown in the empty fields of a new record.
Any suggestions would be appreciated!
I did find one mention somewhere else on the interwebs that said I should put this in the form code:
Is there a way to make this apply to all of the fields, without having to copy/paste that line for each different field in the form?Code:Private Sub Form_Current() Me.FieldName.Visible = (Me.FieldName > 0) End Sub
Thanks!
Last edited by WillysK5; 05-21-2009 at 05:44 PM.
The code you linked isn't going to make the "0" disapear, it will remove the entire field from the form(visibly anyway). I am not sure if that is what you are shooting for. I am not sure how the 0 got there in the first place. One thing you might be able to do is remove the default 0 from the field in table design view. If it is putting a 0 there by default. Otherwise it is going to require code to manipulate the data.
Something like:
Hope this helps,Code:If me.fieldname = "0" then Me.fieldname.ForeColor=#FFFFFF Else me.fieldname.forecolor=#000000 End if
Dan
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
I don't want to removed the whole field, just hide the 0 which automatically shows up in the field.
Yeah, I don't really know why there's a 0 either. As far as I can tell, there's no properties setting that forces a 0 to be there.
I'll try the color thing and let you know.
Thanks!
Last edited by WillysK5; 05-21-2009 at 05:39 PM.
Eh, I'm getting compile errors. "Method or data member not found." And it's highlightingCode:.FieldName
I found it. Back in the table the default value was '0'. I just deleted that and it's fine.
Sheesh...anyone smell n00b?
Thanks!
Np glad I could help.
".Fieldname" needed to be replaced with the name of the field you were trying not to show 0 in.
Dan
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks