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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

docmd.setproperty not working 1

Status
Not open for further replies.

shaunacol

Programmer
Jan 29, 2001
226
GB
I am sure I must be doing something silly...I am just trying to set the value of a control in my subform to false (the code is embedded into my main form behind a button).

I have tried numerous different syntax.... putting into square brackets, round brackets, referencing the subform directly, full stops instead of exclamation marks...even using a macro. When I search on line there is a lot of conflicting info on referencing subforms.

With this code below I get error 438 "object doesn't support this property or method" whereas before I was getting the error message that it didn't recognise the object at all but I'm out of options on what to try now...any help appreciated thanks

DoCmd.SetProperty Forms!FrmProcessEmails!SubAdult.available, acPropertyValue, 0
 
I'm not sure why you are using setproperty. Try:

Code:
Me.SubAdult.Form.available = 0

This assumes the subform control name is SubAdult and the control name is Available. Don't confuse the subform control name and the source object.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016
 
That's correct, the subform control name is "SubAdult" and the control name within that subform is "available". Can you see any reason why this doesn't work please? I'm at the end of my tether with it...
 
And ive even changed the subform name to be the same as the source object as I was worried about that, so they are both now SubAdult. But still get this error.
 
I just tried Me.SubAdult.Form.available = 0 and it works! thank you thank you thank you!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top