You cannot reference the different interfaces through the same object variable. Since you declared oEmp as IHuman that interface is all you have access to. Your code should be
VB Code:
Private Sub Form_Load() Dim oEmp as CEmploye Dim oHuman as IHuman Set oEmp as New CEmploye Set oHuman = oEmp oHuman .Name = "Mike" oHuman .Sex=0 oEmp.Salary = 1000 End Sub




Reply With Quote