Continuous form problem

  • Thread starter lmcc via AccessMonster.com
  • Start date
L

lmcc via AccessMonster.com

I have a imgPencil on a continuous form. OnCurrentEvent is set to:

If Me.txtActivityType = 22 Then
Me.imgPencil.Visible = True
Else
Me.imgPencil.Visible = False
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!
 
D

Douglas J. Steele

No.

While it may look as though you've got, say, 20 different occurrences of
imgPencil on your form, in actual fact, you've got one instance of
imgPencil, repeated 20 times. Changing one instance changes all of them.

It may be possible to achieve what you're trying to do using Conditional
Formatting.
 
L

lmcc via AccessMonster.com

Thanks Douglas,

I was trying not to have to go back and revise my table; I have just the
perfect pencil image I want.

Yes, if I go back and actually add a field into the table then it works.

I have a note field in my table. On the form I have an unbound text box
(txtAddNote); if I enter Y, it will open the Note and so on.

I am using the pencil image to indicate that there are notes in the note
field and so.

No.

While it may look as though you've got, say, 20 different occurrences of
imgPencil on your form, in actual fact, you've got one instance of
imgPencil, repeated 20 times. Changing one instance changes all of them.

It may be possible to achieve what you're trying to do using Conditional
Formatting.
I have a imgPencil on a continuous form. OnCurrentEvent is set to:
[quoted text clipped - 11 lines]
 
A

Allen Browne

If you are using Access 2007 or 2010, you can do it.

The Image control has a Control Source property in these versions.
Just set the Control Source to the field that contains the image (or = a
fully qualified file name for the image.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


lmcc via AccessMonster.com said:
Thanks Douglas,

I was trying not to have to go back and revise my table; I have just the
perfect pencil image I want.

Yes, if I go back and actually add a field into the table then it works.

I have a note field in my table. On the form I have an unbound text box
(txtAddNote); if I enter Y, it will open the Note and so on.

I am using the pencil image to indicate that there are notes in the note
field and so.

No.

While it may look as though you've got, say, 20 different occurrences of
imgPencil on your form, in actual fact, you've got one instance of
imgPencil, repeated 20 times. Changing one instance changes all of them.

It may be possible to achieve what you're trying to do using Conditional
Formatting.
I have a imgPencil on a continuous form. OnCurrentEvent is set to:
[quoted text clipped - 11 lines]
 
L

lmcc via AccessMonster.com

Tried it, not working. I even tried doing an IIF function in the image
control source property.

Allen said:
If you are using Access 2007 or 2010, you can do it.

The Image control has a Control Source property in these versions.
Just set the Control Source to the field that contains the image (or = a
fully qualified file name for the image.)
Thanks Douglas,
[quoted text clipped - 23 lines]
 
A

Allen Browne

Post some details of what you have:
a) For the Image control on your form, post its:
- Control Source
- Name

b) For the graphic field in your table, post its:
- Name
- Data Type

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Allen Browne said:
If you are using Access 2007 or 2010, you can do it.

The Image control has a Control Source property in these versions.
Just set the Control Source to the field that contains the image (or = a
fully qualified file name for the image.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


lmcc via AccessMonster.com said:
Thanks Douglas,

I was trying not to have to go back and revise my table; I have just the
perfect pencil image I want.

Yes, if I go back and actually add a field into the table then it works.

I have a note field in my table. On the form I have an unbound text box
(txtAddNote); if I enter Y, it will open the Note and so on.

I am using the pencil image to indicate that there are notes in the note
field and so.

No.

While it may look as though you've got, say, 20 different occurrences of
imgPencil on your form, in actual fact, you've got one instance of
imgPencil, repeated 20 times. Changing one instance changes all of them.

It may be possible to achieve what you're trying to do using Conditional
Formatting.

I have a imgPencil on a continuous form. OnCurrentEvent is set to:

[quoted text clipped - 11 lines]

Thanks!
 
L

lmcc via AccessMonster.com

Here is what I posted on the imgPencil control:

=IIf([txtActivityType]=22,[imgPencil].[Visible]=True,Null)


Do not have a graphic field in my table.


When I do the below it works:

To display a pencil for records with txtActivityType = 22, created a
text box--

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

I am assuming that an image control doesn't work like the text box control.


Allen said:
Post some details of what you have:
a) For the Image control on your form, post its:
- Control Source
- Name

b) For the graphic field in your table, post its:
- Name
- Data Type
If you are using Access 2007 or 2010, you can do it.
[quoted text clipped - 29 lines]
 
A

Allen Browne

Okay, you don't have a field that contains the image to display, but you do
have a solution using a Wingdings character.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


lmcc via AccessMonster.com said:
Here is what I posted on the imgPencil control:

=IIf([txtActivityType]=22,[imgPencil].[Visible]=True,Null)


Do not have a graphic field in my table.


When I do the below it works:

To display a pencil for records with txtActivityType = 22, created a
text box--

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

I am assuming that an image control doesn't work like the text box
control.


Allen said:
Post some details of what you have:
a) For the Image control on your form, post its:
- Control Source
- Name

b) For the graphic field in your table, post its:
- Name
- Data Type
If you are using Access 2007 or 2010, you can do it.
[quoted text clipped - 29 lines]
 
L

lmcc via AccessMonster.com

You can't do the same with an image as you can with a text box? Because I
entered the same code in the control source property of the image and nothing
happened.

Allen said:
Okay, you don't have a field that contains the image to display, but you do
have a solution using a Wingdings character.
Here is what I posted on the imgPencil control:
[quoted text clipped - 27 lines]
 

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