Be able to Choose between 2 different constants

  • Thread starter Thread starter bobdydd
  • Start date Start date
B

bobdydd

Hi Everybody

I am trying to select a constant depending on whether a box is ticked
and I cannot use the usual techniques outside of a procedure
has anyone got any ideas how to get aroud this?

Regards Bob

If Me.chkTabs = 0 Then
'Private Const adhcTable = "UsysTEMPCategory"
Private Const adhcFieldName = "SupplierCategory"

End If
If Me.chkTabs = -1 Then
Private Const adhcTable = "UsysTEMPStortvalleyCategory"
Private Const adhcFieldName = "StortvalleyCategorytxt"
'End If
 
A constant's value is determined when it is declared and by definition,
cannot be changed in code. It's a <CONSTANT>.
Your code attempts to declare a constant in a procedure. That's a NO NO.
Probably what you want to do is declare global variables and then assign
them values, as you are currently trying to do in your code.

HTH, UpRider
 
A constant's value is determined when it is declared and by definition,
cannot be changed in code.  It's a <CONSTANT>.
Your code attempts to declare a constant in a procedure. That's a NO NO.
Probably what you want to do is declare global variables and then assign
them values, as you are currently trying to do in your code.

HTH, UpRider

Thanks

I should have known that
Your help saved me wasting a lot of time.

Regards
Bob
 
Back
Top