Check box problems

  • Thread starter Thread starter Clown Patrol
  • Start date Start date
C

Clown Patrol

Guest
Okay,

I am pretty "green" with access. I have a check box, that when checked will make a text box appear.

Private Sub NS_EVENT_ID_GotFocus()
If Me.NS_REPEL_1 = -1 Then
Me.NS_REPEL_1A.Visible = True
Else
Me.NS_REPEL_1A.Visible = False
End If
End Sub


My form has multiple tabs and when I select the next record, the text box (which is set to NOT be visible) acts upon the last action which may or may not have made the text box visible. I must reload the entire form just to see the fields correctly. Can anyone help?

Thanks,
CP
 
Clown Patrol said:
Okay,

I am pretty "green" with access. I have a check box, that when checked will make a text box appear.

Private Sub NS_EVENT_ID_GotFocus()
If Me.NS_REPEL_1 = -1 Then
Me.NS_REPEL_1A.Visible = True
Else
Me.NS_REPEL_1A.Visible = False
End If
End Sub


My form has multiple tabs and when I select the next record, the text box (which is set to NOT be visible) acts upon the last action which may or may not have made the text box visible. I must reload the entire form just to see the fields correctly. Can anyone help?

Thanks,
CP
I am also pretty green with access, but it seems like to me that you are using the wrong event. GotFocus doesn't seem like an event you can reliably predict. trying:

Private Sub NS_EVENT_ID_Click()


would be my first suggestion.
 
Thanks,

I tried that however what is happening when I select another record, say record 3, there is no click because I am using the record navigation buttons at the bottom of the form. So I have used the mouse move function to somewhat resolve the issue. Not pretty but works. I would think there is a better way...
 
Ok, i think i understand now. The undesirable sequence of events occurs like this:

  • Form is opened. The checkbox is false and the textbox is invisible.[/*]
  • User checks box, textbox appears.[/*]
  • User moves to next record.[/*]
  • Textbox is visible when it should be invisible.[/*]

Is this what happens? If so try adding an event procedure for the Forms OnCurrent
Code:
Private Sub Form1_OnCurrent()
   Me.NS_REPEL_1A.Visible = False
End Sub
but i may be way off base here
/me is not an access guru
 
Thanks,

Sorry not to post, was off a few days. I tried that and a few other this like mouse move and I think it is under control. :cool:
 

Users who are viewing this thread

Back
Top Bottom