Continuous Form OnCurrentEvent

lmcc007

Registered User.
Local time
Today, 06:59
Joined
Nov 10, 2007
Messages
635
I have a imgPencil on a continuous form. OnCurrentEvent is set to:

If Me.txtActivityType = 22 Then
Me.imgPencil.Visible = True​
End If
The above code works fine on a Single Form. Is there a way to get it work on a continuous form without affecting all the other records.

Thanks!
 
To my knowledge, conditional formatting is just about the only thing that will individually format records on a continuous form. You may want to give it another try.
 
To my knowledge, conditional formatting is just about the only thing that will individually format records on a continuous form. You may want to give it another try.

I am trying to make Me.imgPencil.Visible = True if txtActivityType = 22.
 
OK. Conditional formatting is just about the only thing that allows you to have any difference in the layout of records on a continuous subform - but, you are right it can't make things visible or not - it can only change text colors and properties, etc...

There is one other way that I know of that will work only if you have Access 2007. In 2007, each record on a continuous subform can have a unique image.

Here's how to do it:

1) Create a table with an attachment field and and ID field. On the record with ID 22 (or any number you want), add your Pencil image as an attachment.

2) Create a query that links your data table with your new image table.

3) Set your continuous forms recordsource to the new query.

I attached a sample database showing how this can be done.
Let me know if it will work for you...

Evan
 

Attachments

Thanks Evan,

I see where you are going. I don't want to create any more tables or queries.

I finally found the answer. Here is how he got it to work:

If you want to display a pencil for records with txtActivityType =22, you can create a text box:

Control Source: =IIf([txtActivityType]=22,"!",Null)
Font: Wingdings​

I guess the key is using a text box and not an image control even though the image control has a Control Source.
 

Users who are viewing this thread

Back
Top Bottom