Hello Liz, Crystal,
Solution is halfway working, I need to advance to new record, then go back inorder to take effect.. it seems it is not refreshing after putting a value in Attachment control.
How to refresh it, taking note that the button is sitting in he mainform and the control is in the subform?
By the way, data type of the control is text and it is a textbox control..
Thank you,
Zjubias
Hi Zjubias,
Liz is close (Hi Liz, good to see you helping others), but I think it would go more like this:
current event of the subform:
Me.parent.cmdButton_controlname.enabled = Not ( isnull(me.attachment) )
of course, you could expand the code out to this (still on current event of subform):
if isnull(me.attachment) then
Me.parent.cmdButton_controlname.enabled = false
else
Me.parent.cmdButton_controlname.enabled = true
end if
... and you'd also want to do this on the AfterUpdate event of the control this condition is dependent upon ...
~~~
However, the field name "Attachment" makes me wonder if the number of attachments have to be counted as opposed to seeing if there is simply a value ... what is the data type ? what is the control type?
warm regards,
crystal
Microsoft Access Basics
https://www.goskills.com/Course/Access-Basics
40 lessons to empower you to build an application with Access.
on sale till Dec 26 for 29 with a year to finish (less than 1/lesson) ... https://www.goskills.com/Gifts
~ have an awesome day ~
On 12/21/2015 11:14 AM, Liz Ravenwood liz_ravenwood@beaerospace.com [MS_Access_Professionals] wrote:
Something like this?
On current event of main form
If isnull(me.subformname.attachment) then
Me.cmdButton.enabled = false
Else
Me.cmdButton.enabled = true
End if
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Monday, December 21, 2015 11:11 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Referring control in a SubForm
Dear All,
I have this situation, I have a mainform with a subform. On my mainform I have a command button that I would like to enable/disable, depending on the control in my subform..
I would like to disable my command button in my mainform if "Attachment" control in my subform is empty.. (I want to make sure that user will not be able to click the command button if attachment is null/empty)..
Thank you..
Zjubias
Posted by: Moi Ubias <zjubias@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar