Help with coding

E

Eric Starn

I have a form that I need help coding on. The form opens when you query an
employee’s name. The form has a few different fields on it but, what I want
to have it display is an image that says “Pass†or “No Pass†depending on the
situation. I have asked some questions and I was told to set the images on
top of each other and then set the visibility to the current situation. The
criteria for the “Pass†image is that in the table I have eight check box
fields and they need to be all true to pass if not then it is “No Passâ€.
So I need help in lining this all up to do this. I have already created the
desired images as .bmp files but have no idea how to code this

I hope someone can help me.

If you need more info I will gladly supply it.

Eric
 
M

Marshall Barton

Eric said:
I have a form that I need help coding on. The form opens when you query an
employee’s name. The form has a few different fields on it but, what I want
to have it display is an image that says “Pass” or “No Pass” depending on the
situation. I have asked some questions and I was told to set the images on
top of each other and then set the visibility to the current situation. The
criteria for the “Pass” image is that in the table I have eight check box
fields and they need to be all true to pass if not then it is “No Pass”.
So I need help in lining this all up to do this. I have already created the
desired images as .bmp files but have no idea how to code this


I think all you need is a little code in the form's Current
event procedure:

Me.PassImage.Visible = Me.chk1 And Me.chk2 And ...
Me.NoPassImage.Visible = Not (Me.chk1 And Me.chk2 And ...)
 
E

Eric Starn

Thanks

I am just not sure on writing the code to make it work right

Do you use Me.chk1 or do you replace it with Me.(the field name)

Eric
 
M

Marshall Barton

Eric said:
I am just not sure on writing the code to make it work right

Do you use Me.chk1 or do you replace it with Me.(the field name)


Replace the chk1, etc with the names of your check boxes.

If each check box is bound to a field in the form's record
source table/query, then you could use the field name, but I
still prefer to use the control name.
 
E

Eric Starn

Ok I got a problem

This is what I put in the On Current box

Private Sub Form_Current()
Me.PassImage.Visible = Me.IS____200 And Me.IS___100 And Me.IS___300 And
Me.IS___700 And Me.IS___800 And Me.Rep_101 And Me.E___Team
Me.NoPassImage.Visble = Not (Me.IS____200 And Me.IS___100 And
Me.IS___300 And Me.IS___700 And Me.IS___800 And Me.Rep_101 And Me.E___Team)
End Sub

The error is a Compile error: Method or data member not found

Not sure what this is or how to fix it

Eric
 
M

Marshall Barton

Eric said:
This is what I put in the On Current box

Private Sub Form_Current()
Me.PassImage.Visible = Me.IS____200 And Me.IS___100 And Me.IS___300 And
Me.IS___700 And Me.IS___800 And Me.Rep_101 And Me.E___Team
Me.NoPassImage.Visble = Not (Me.IS____200 And Me.IS___100 And
Me.IS___300 And Me.IS___700 And Me.IS___800 And Me.Rep_101 And Me.E___Team)
End Sub

The error is a Compile error: Method or data member not found

Not sure what this is or how to fix it


That most likely means the one or more of the names you used
is not correct.

Those are pretty ugly names. Are you sure that you counted
the number of underscores correctly? Personally, I would
not want to have to do that so I would never use more than
one underscore, or, preferably no underscores at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top