A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can you mark a command box as already selected?



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2006, 04:45 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Can you mark a command box as already selected?

I was wondering if there was anyway to mark a command box as being selected
once it is clicked. I'm trying to create a training game and I don't want
trainees to select the same category twice.
  #2  
Old April 11th, 2006, 05:18 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Can you mark a command box as already selected?

Try using a Toggle Button, rather than a Command Button. Clicking on a
Toggle Button depresses it, so that you can tell it's already been clicked.

You can also put a Static variable in the Click event of the Command Button
to keep track of whether it's already been clicked:

Private Sub Command0_Click()
Static booClicked As Boolean

If booClicked = False Then
' put your code that's supposed to happen when you click here

booClicked = True
Else
MsgBox "You've already clicked on the button"
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"jhucks8" wrote in message
...
I was wondering if there was anyway to mark a command box as being

selected
once it is clicked. I'm trying to create a training game and I don't want
trainees to select the same category twice.



  #3  
Old April 12th, 2006, 02:38 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Can you mark a command box as already selected?

Thanks Douglas! That really helps!

"Douglas J Steele" wrote:

Try using a Toggle Button, rather than a Command Button. Clicking on a
Toggle Button depresses it, so that you can tell it's already been clicked.

You can also put a Static variable in the Click event of the Command Button
to keep track of whether it's already been clicked:

Private Sub Command0_Click()
Static booClicked As Boolean

If booClicked = False Then
' put your code that's supposed to happen when you click here

booClicked = True
Else
MsgBox "You've already clicked on the button"
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"jhucks8" wrote in message
...
I was wondering if there was anyway to mark a command box as being

selected
once it is clicked. I'm trying to create a training game and I don't want
trainees to select the same category twice.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
getting single selected value from listbox smarty Using Forms 12 March 21st, 2006 06:16 PM
SET A SUBFORM TO PRINT ONLY SELECTED RECORD IN A FORM BEE Using Forms 1 June 15th, 2005 08:27 PM
How can I add only on selected Criteria only? Donna General Discussion 1 June 13th, 2005 04:19 PM
list box doesn't store the selected value until closing the form Lin Using Forms 2 November 3rd, 2004 05:34 PM
run macro when worksheet is selected Carl Worksheet Functions 4 October 3rd, 2004 04:29 PM


All times are GMT +1. The time now is 09:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.