sja13
Professional Idiot
- Local time
- Today, 20:58
- Joined
- May 3, 2017
- Messages
- 63
Hi...
The Background
I have a Form, on which there is an Image.
The Image is either a photo of an object, or a "default" photo saying "Awaiting Image".
The photos are NOT embedded - they are paths to images in sub-folders.
The Requirement
I want to allow the User to double-click the photo to get the option to either
I wanted to be able to "grey-out" certain Radio buttons in certain situations (e.g. If the Image is "Awiting Image", disable the "Remove" button.
The Problem
I'm trying to set up the Radio buttons in a subroutine called from the Image's "Double-click" code, but I can't find the right code to access them.
I issue
then try to access the controls on "frmImage"
I've tried several ways, the current being (where strPath is the path to the image, gstrA_I_Full is the path to the "Awaiting Image jpg, and the Radio buttons on the pop-up form frmImage are optAdd, optEdit and optDel)
I've also tried to reference the frmImage controls with
and
and variants of the above replacing some or all of the "."s with "!"s and vice-versa.
I either get "Object doesn't support this property or method" or "Cannot find the named object" or variants thereof.
Can any kind soul point me in the right direction?
Is it because it's a pop-up Form? Should I be approaching this in some other way?
Please help if you can....
The Background
I have a Form, on which there is an Image.
The Image is either a photo of an object, or a "default" photo saying "Awaiting Image".
The photos are NOT embedded - they are paths to images in sub-folders.
The Requirement
I want to allow the User to double-click the photo to get the option to either
- replace the photo with another one (i.e. "Awaiting Image" changes to a photo, or
- change the existing photo to a different one, or
- change the existing photo to "Awaiting Image"
I wanted to be able to "grey-out" certain Radio buttons in certain situations (e.g. If the Image is "Awiting Image", disable the "Remove" button.
The Problem
I'm trying to set up the Radio buttons in a subroutine called from the Image's "Double-click" code, but I can't find the right code to access them.
I issue
Code:
DoCmd.OpenForm "frmImage", acNormal
I've tried several ways, the current being (where strPath is the path to the image, gstrA_I_Full is the path to the "Awaiting Image jpg, and the Radio buttons on the pop-up form frmImage are optAdd, optEdit and optDel)
Code:
With CurrentProject.AllForms("frmImage")
Select Case strPath
Case Is = "", Is = gstrA_I_Full 'No Del
.Controls("optAdd").Enabled = True
.Controls("optEdit").Enabled = True
.Controls("optDel").Enabled = False
Case Else 'No Add
.Controls("optAdd").Enabled = False
.Controls("optEdit").Enabled = True
.Controls("optDel").Enabled = True
End Select
End With
Code:
With Forms!frmImage
Code:
Forms!frmImage!optEdit.Controls("optAdd").Enabled = True
I either get "Object doesn't support this property or method" or "Cannot find the named object" or variants thereof.
Can any kind soul point me in the right direction?
Is it because it's a pop-up Form? Should I be approaching this in some other way?
Please help if you can....