By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,549 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,549 IT Pros & Developers. It's quick & easy.

Associate form events with default record navigation buttons

lwwhite
P: 16
Another question. On one of my forms, I have two radio buttons: Topic and Window. Beside each of them is a drop-down to select the corresponding topic or window. When Topic is selected the window drop-down is disabled, and vice-versa.

But what I'd like to do is give the appearance of one field only. So I placed the topic drop-down directly on top of the window drop-down and set their Visible properties using the On Mouse Down event of the Topic and Window radio buttons. So far so good. Works like a charm when the form first opens.

Problem is, this is a child form whereby you view all the records associated with the record on the parent form, so I'm using the native Access navigation buttons at the bottom of the window to move from one record to another. When you move from one record to the next, the fields don't appear as predicted; the topic drop-down is always the one visible, even if the Window radio button is selected.

How can I (or can I) associate my On Current event with these buttons to have the form refresh itself for each new record?

Thank you!
Jan 22 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,628
Another question. On one of my forms, I have two radio buttons: Topic and Window. Beside each of them is a drop-down to select the corresponding topic or window. When Topic is selected the window drop-down is disabled, and vice-versa.

But what I'd like to do is give the appearance of one field only. So I placed the topic drop-down directly on top of the window drop-down and set their Visible properties using the On Mouse Down event of the Topic and Window radio buttons. So far so good. Works like a charm when the form first opens.

Problem is, this is a child form whereby you view all the records associated with the record on the parent form, so I'm using the native Access navigation buttons at the bottom of the window to move from one record to another. When you move from one record to the next, the fields don't appear as predicted; the topic drop-down is always the one visible, even if the Window radio button is selected.

How can I (or can I) associate my On Current event with these buttons to have the form refresh itself for each new record?

Thank you!
Assuming that your Radio Buttons are in an Option Group (making them mutually exclusive), this Generic Code will work:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.  
  3. Select Case Nz(optTest.Value)
  4.   Case 1    'Topic Radio Button selected
  5.     Me![cboTopic].Visible = True
  6.     Me![cboWindow].Visible = False
  7.   Case 2    'Window Radio Button selected
  8.     Me![cboTopic].Visible = False
  9.     Me![cboWindow].Visible = True
  10.   Case Else 'No Button selected
  11.     Me![cboTopic].Visible = False
  12.     Me![cboWindow].Visible = False
  13. End Select
  14.  
  15. End Sub
Jan 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.