OnLoad set button value

  • Thread starter Igor via AccessMonster.com
  • Start date
I

Igor via AccessMonster.com

Hey guys,

Hopefully a quick question... I have a command button running a 'lock/unlock
fields' procedure. When I open the form, it is in the unlocked mode,
obviously Id prefer it to load as 'locked'. I'm trying the code below, but
it is returning the message 'Compile Error Method or Data Member Not Found'.
and highlights the '.Value' , I have tried removing the '.value' and then it
returns a Complie Error Syntax Problem.

Private Sub Form_Load()
Me.cmdLock.Value = True
Call Sub cmdLock_AfterUpdate
End Sub

Im a newbie at coding, so thanks for patience. Am I correct in this approach?
Do command buttons have true/false values?
 
J

JethroUK©

command buttons don't have true/false ('a state') values - 2 choices

1/ replace the command button with a checkbox

2/ click the button on load:

Private Sub Form_Load()
cmdlock_click
End Sub
 
I

Igor via AccessMonster.com

Thanks for the suggestion Jethro, but I need to stick with the command button.
Its for a Record Editing feature for the User, and the button ties in to
several sub procedures. There must be a way to determine what state the
button is in OnLoad. Pressed/Depressed... I have found some suggestions
online, I tried incorporating these as outlined in my above post. But, no
luck. Any other ideas?
 
I

Igor via AccessMonster.com

Nevermind I got it.. As simple a case as making sure it was set to 'no' in
default view. Thanks anyway
 
Top