Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Required

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
GB
Can anyone help with the following I have a form in which I am trying to set enabled to false on a control on my form
The code underlying the form conditionally calls a function based on criteria of forms controls and this works fine

The function then runs through the first 6 lines on the code and works fine until it gets to the next line where I am tryig to disable a control called "Total Percentage in System"
I then get an 'object required' message

In fact I get an 'object required' message every time my code refers to this control

Here is the code

If (Forms![Cost Authorisation Preparation Form]![Status Count 3] = 31 And Forms![Cost Authorisation Preparation Form]![Job Number] = "None") Then Forms![Cost Authorisation Preparation Form]![Total Percentage in System].[Enabled] = False

This line seems to work if if refers to another control on the form

Many thanks for any help you can give me

 
Double check the spelling of this control.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks

Have checked the spelling and I'm still getting the same problem

 
You may use the expression builder to discover the real name of this control.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
BTW, you don't have a control in the form having the same name than a field in the underlaying table/query ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks

Have created the condition in a macro, pasted it into my code and it works so many thanks
 
Any chance you could post the working code ?
 
If (Forms![Cost Authorisation Preparation Form]![Status Count 3] = 31 And Forms![Cost Authorisation Preparation Form]![Job Number] = "None") Then Forms![Cost Authorisation Preparation Form]![Total Percentage in System].Enabled = False

Here it is - I think the problem was the fact that Enabled = False was entered as [Enabled] = False

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top