Hi Zjubias
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 ~
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: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar