My Assistant
![]() ![]() |
|
|
Apr 8 2005, 09:26 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 296 From: Toronto Canada |
Hi there guys,
I have a form and I want to add a check box in it, to give the user an option to open a different form. The user enters the order number in a text box. My code runs after the update event of the text box. I have added this code which is not working. Private Sub txtOrder_AfterUpdate() code code code New code if Me.chkbox Then DoCmd.OpenForm "MY_New_Form" exit sub end if . . End Sub The new form opens, no matter if the check box is checked or not. I've no idea why its doing that. Anyone have any ideas. Thanks for your time and advice in advance. |
|
|
|
Apr 8 2005, 09:27 AM
Post
#2
|
|
|
UtterAccess Ruler Posts: 1,208 From: Cochrane, Ontario, Canada |
Have you tried:
If Me.chkbox = True Then |
|
|
|
Apr 8 2005, 09:31 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Me.chkbox.Value = True Then
should do the same thing like malcom suggested. You have to check for the value of the checkbox and not for the checkbox itself. Good luck. |
|
|
|
Apr 8 2005, 09:41 AM
Post
#4
|
|
|
UtterAccess Addict Posts: 296 From: Toronto Canada |
I had tried If Me.chkbox = True then
but it didn't work. I just tried If Me.chkbox.Value = True then but it gives me the same result, it opens the form no matter if the box is check or not. I would've changed the checkbox to a command button, but I need the AfterUpdate event code to run before I can open the form. So I need a way to know what the user wants to do before I run the UpdateEvent. Thank you very much for your time and advice. How are you doing Oliver (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif) Edited by: iftikhar_k on Fri Apr 8 10:43:32 EDT 2005. |
|
|
|
Apr 8 2005, 09:46 AM
Post
#5
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Is this an unbound checkbox?
Try: Forms!FormName!chkbox.value = True Or [Forms]![FormName].chkbox.value = True Or Me.FormName.chkbox.value = True Play around with it. |
|
|
|
Apr 8 2005, 10:26 AM
Post
#6
|
|
|
UtterAccess Addict Posts: 296 From: Toronto Canada |
I tried all the options, but no luck, I'm totally shocked, its not like I've not used check boxes before. I don't know this one is soo stubborn, I must be doing some logical error somewhere. I deleted the check box made a new one, but that one is behaving the same way.
I guess I'll just find another way to do it and forget the check box idea. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 07:49 AM |