Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detail format event procedure 1

Status
Not open for further replies.

Junior1544

Technical User
Apr 20, 2001
1,267
US
I was hoping some one could help me with this... i am tring to get this to work and i can't seem to... acording to the help it should be fine.

btw, i'm using access 2000 in a windows 2000 enviroment.
it's a muti-user database being split into a front end/back end with the front end on the users pc's. (only 5 users, usualy only 3 at a time)

here is the code i'm using...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.HAIR = Null Then
Me!HAIR.BackColor = 0
End If


End Sub


now i'm doing this to just get it working then i'm going to expand it... i tried going into the debug window and in the imediate window typed this:
debug.print me.hair
and it responded:
NULL
but when i steped though, it skiped right over my if... as if it were false, and i can't figure it out... any idea's??

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
James,

Try:
Code:
If IsNull(HAIR) Then
Me.HAIR.BackColor = 0
End If
 
You are the man CosmoKramer!

here's a star!

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
this is working great, except for one control! even when it display's empty, it still thinks there is a number in it... i used the same format as the others... this is working very well for almost ten controls... just this one thinks there is a number in the field when there isn't...

8160 is the number that it thinks is there... i don't understand it because it display's the information fine, when there is a number or when there isn't... but still see's that number in the program...

i don't get it... i double checked to make sure that the control name is correct, and that there arn't more then one control on there with that name...

--James
[nosmiley] junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
I don't understand, the field's backcolor is not changing even though it appears blank??
 
yup... i brought up the display window(ctrl-g) and did a debug.print and it came up with that number 8160... even though it displayed black... i went to a different record that there was information in that field... it displayed fine, but i did another debug.print and it said the same number... that's why i'm confused.

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Sorry James, my bad....[ponder] I forgot to have you reset the backcolor if the field is not null....Try this instead:
Code:
If IsNull(HAIR) Then
 Me.HAIR.BackColor = vbBlack
Else
 Me.HAIR.BackColor = vbWhite
End If
 
it's still white even if there is no data in that field...

i got this working in 7 other control's... just this one is giving me a hard time... i don't understand why vba thinks there is a number in the field i'm working on...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
I figured out the problem i was having with the one field... I just wanted to let you know... The field name was a reserved word(HEIGHT)... I never even thought of that because some one that said they have been working with databases for many years is the one that developed it...

--James junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top