Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

yes/no boxes in programming.

Status
Not open for further replies.

rotschreck

Programmer
Jan 26, 2000
54
0
0
CA
www.geocities.com
Here is my code. I'm trying to put a checkmark into the Yes/No of the Plotted field. It looks like it should work, but it doesn't. No error messages, no actions either....<br><br>TIA<br><br>Private Sub Status_Exit(Cancel As Integer)<br>If Status = &quot;Recorded&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;Plotted = &quot;Yes&quot;<br>End If<br>End Sub <p> <br><a href=mailto: > </a><br><a href= Eclectic Page</a><br>
 
Be sure to check that Status does equal &quot;Recorded&quot;<br>To check this add the following line of code right before the If..Then statement<br><br>MsgBox(Status)<br><br>This will show you the value of status before executing the If..Then.&nbsp;&nbsp;If this box shows the value &quot;Recorded&quot;, the only other thing I can think of is that your checkbox object is not named 'Plotted'.<br><br>tone
 
use Plotted = True<br>instead of <br>Plotted = &quot;Yes&quot; <br>--Jim
 
Alright,<br><br>Thanks for the help.<br><br>tone, I've put your code in. I don't receive anything. No MsgBox.<br><br>That would explain why Jim's code doesn't seem to help. My code doesn't find anything so it has nothing to check....<br><br>so what is wrong with my code? why aren't I reading anything? <p> <br><a href=mailto: > </a><br><a href= Eclectic Page</a><br>
 
If you are trying to get the &quot;plotted&quot; checkbox value set as you move from record to record, then you want the Form_Current event.<br><br>If you want it set based on the value of &quot;Status&quot; being modified, then you want the Status_AfterUpdate event.<br><br>The event you are using is mainly used to restore some state that was set using the Status_Enter event. <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
Rotschrck,<br><br>You say that you got no message box when you added the code I suggested.&nbsp;&nbsp;If that is the case it looks like you are not even entering the Status_Exit event.&nbsp;&nbsp;If the box came up but was blank with just an 'OK' button then you got into the event.&nbsp;&nbsp;Have you tried tracing your code using stops to make sure you get into the event.&nbsp;&nbsp;To do this open your code page and in the left margin click the mouse.&nbsp;&nbsp;This will cause a red bullet to appear beside the line of code where you clicked.&nbsp;&nbsp;Run your form and the execution will pause when this line of code is encountered.&nbsp;&nbsp;If you put a stop inside the Status_Exit event and the program never pauses and displays the code page you know you are not entering the event.&nbsp;&nbsp;If it does pause and the code page appears try the following.&nbsp;&nbsp;Hover your mouse over the word Status in your If..Then statement.&nbsp;&nbsp;When you do this the current value of Status will be displayed in an info box.&nbsp;&nbsp;To continue execution just click the play button in the tool bar to start the program at the break point.<br><br>HTH<br><br>tone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top