Link to home
Start Free TrialLog in
Avatar of axnst2
axnst2Flag for United States of America

asked on

Defult value of an object

I am trying to set a default value for "sheet" below.  Meaning if it hasn't been set to anything yet then return 0 by default.  How do I do that?

private mSheet as long

Public Property Get Sheet() As Long
  Sheet = mSheet
End Property

Thanks,
axnst1
Avatar of vb_elmar
vb_elmar
Flag of Germany image

You can arrange a Constant. When running the Program, Me.Sheet = 1
or any other Value you want.

Const mSheet = 1

Public Property Get Sheet() As Long
  Sheet = mSheet
End Property

Private Sub Form_Load()
Caption = Me.Sheet
End Sub
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Get is a read only property. Do you want to write to "Sheet" ?