OnLoad set button value

  • Thread starter Thread starter Igor via AccessMonster.com
  • Start date 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?
 
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
 
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?
 
Nevermind I got it.. As simple a case as making sure it was set to 'no' in
default view. Thanks anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top