Disabled field in mainform if any value in linked subform = "inprogress"

sami4net

New member
Local time
Today, 01:50
Joined
Oct 20, 2010
Messages
6
I have main from linked with subform ( relation one to many)
i want command if subfrom records.value = "inprogress" then
me.parent.filed.enabled=false
Else
me.parent.filed.enabled=true


The subform can contant many records so if any records value = "inprogrees"

i want disabled one filed in mainform
 
Last edited by a moderator:
Re: Disabled field in mainform if any value in linked subform = "inprogress"

1. It is FORM not FROM

2. It is FIELD not FILED

3. What is the name of the control which houses your field you want disabled on the main form?
 
Re: Disabled field in mainform if any value in linked subform = "inprogress"

Hey Bob,

Thanks a lot for notes

The Filed in main form name is JOB_STATUS

The Filed in subform name is STATUS

all of them listbox contents 3 status
-Inprogress
-Completed
-Cancel

i want if any value in subform records content "Inprogress" then
Me.parent.JOB_STATUS.enabled= false
Else
Me.parent.JOB_STATUS.enabled= true
end if
 
Re: Disabled field in mainform if any value in linked subform = "inprogress"

So something like this?

Code:
Me.Parent.Job_Status.Enabled = Not (Me.Status = "inprogress")

That one line can substitute for all of your code. However, you need to make sure that the CONTROL names are Job_Status and Status (not the fields). We aren't disabling FIELDS we are enabling or disabling CONTROLS on a form. There is a distinct difference which I gather you are not aware of.

A FIELD is in the record source table or query. The CONTROL is the thing that is BOUND to a field.
 
Re: Disabled field in mainform if any value in linked subform = "inprogress"

The subform contants many records example


Main Form

Customer#____ Name _____ JOB_STATUS
12554 _________ BOB ________"empty and Disabled"

Subform
NO___ ITEMS _____STATUS
1 _____ install _____inprogress
2 _____ repair _____completed


If any record in subform = "inprogress" , i want disabled JOB_STATUS

i need code to check all value (STATUS field) in subform

So user can't change JOB_STATUS till he change STATUS for ITEM number 1 to completed or cancel.
 
Last edited:
Re: Disabled field in mainform if any value in linked subform = "inprogress"

_____________________ Up ___________________
 

Users who are viewing this thread

Back
Top Bottom