Current record on clicking unbound image

bodylojohn

Registered User.
Local time
Today, 08:05
Joined
Dec 28, 2005
Messages
205
Hello everyone,

I have a continious form with a picture of a delete button.
When I press the button I want to see the currentrecord ID.

To test this I simply use the code msgbox(me.ID.value)

When I click on the unbound image the msgbox shows the first ID no matter wich row I click.

However....When I click in a textbox in the row (the row gets the focus) and then I press on the button, the right ID appears in the messagebox.

What can I do so the right ID appears?
 
You will need this:

Code:
Screen.PreviousControl.SetFocus
MsgBox Me.ID
 
Hello everyone,

I have a continious form with a picture of a delete button.
When I press the button I want to see the currentrecord ID.

To test this I simply use the code msgbox(me.ID.value)

When I click on the unbound image the msgbox shows the first ID no matter wich row I click.

However....When I click in a textbox in the row (the row gets the focus) and then I press on the button, the right ID appears in the messagebox.

What can I do so the right ID appears?

In what section have you placed the image control?

It sounds like it is probably in the form header or footer section. If this is true then you must first select a record in some way.. Normally by clicking in a control or the record select if visible.

To avoid having to first select the record, you will need to move the image control nto the detail section.
 
In what section have you placed the image control?

It sounds like it is probably in the form header or footer section. If this is true then you must first select a record in some way.. Normally by clicking in a control or the record select if visible.

To avoid having to first select the record, you will need to move the image control nto the detail section.

Hello,

The image control is already in het detail section.

I hope that you can give me some more pointers
 
Hello,

The image control is already in het detail section.

I hope that you can give me some more pointers

Did you try my code? You make sure you are on the record you want and then click the image. It should give you what you need.
 
Hello,

The image control is already in het detail section.

I hope that you can give me some more pointers

Did you try Bob's code?

I normally use a transparent command button over the image control. I use the command button's On Click event.
 
Did you try my code? You make sure you are on the record you want and then click the image. It should give you what you need.

Hello,

Thanks for the tip.
Unfortunately it didnt work. I placed a button instead of the image. It looks ugly but it workt.
I think it is because the image control cant get the focus.
 
Hello,

Thanks for the tip.
Unfortunately it didnt work. I placed a button instead of the image. It looks ugly but it workt.
I think it is because the image control cant get the focus.

Why does it look ugly if the command button is transparent and the same size as the image control?

Ahh... just thought of this ....did you make sure to bring the command button tot he front the and/or send the image control to the back?
 
Why does it look ugly if the command button is transparent and the same size as the image control?

Ahh... just thought of this ....did you make sure to bring the command button tot he front the and/or send the image control to the back?

Bro...you are a geniuos!!!

This works PERFECT.

Thanks for all your help!
 

Users who are viewing this thread

Back
Top Bottom