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

help on error 438 object doesn't support this property or method

Status
Not open for further replies.

JoseMarques

Programmer
May 9, 2012
19
PT
Hello

I'm working on an application that has a form that is inside a tab control which is in turn inside another form with a tab control.

The forms and tab control i use:

Form:trab
tab control:FRC
Form:FRCdisp
tab control:Registo
Form:Registo
subform:predrust

I'm trying to copy data to a text box on the main form 'Registo' of a sub form fuction 'Predrust'.

The code i use:
...
10:Set rs = New ADODB.Recordset
11:str = "SELECT * From Plantacoes where id = '" & idcarr & "' "
12:rs.Open str, iconn, adOpenDynamic, adLockOptimistic
13:Forms![trab]![FRCdisp]![Registo].Form!conc = rs!Concelho
...

The error 438 its in the line 13.

I use the code of line 13 on the main form function and it works well.

Help please
 
I think you are confusing matters by having a control and form named the same (Registo) because you are gettng the tab control and not the form. Actually you want the name of the subform control not the name of the subform.... So likely you have the name. Check that and note the difference in syntax below.

Try this instead...

Code:
Forms![trab]![FRCdisp][red].Form[/red]![Registo].Form!conc = rs!Concelho
 
Thanks but didn't work.
I tried your way and giving a new name but give the same error.
 
So you replaced Registo with your subform control name... is conc the name of a control? If not try substituting a control name.
 
Yes 'conc' it's the name of the control.
And no I didn't replace the name of the form with the name of the subform. I gave the form a new name.
 
Do you follow that every sub form is in a sub form control and you want to use the name of the control and not the name of the sub form object?

Also not mentioned is that you should be able to completely ignore the tab control in your syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top