Re-hide my combo boxes when I go to the next record

G

Guest

I have a combo box that apears if you select yes in another combo box. When I
go to the next record all my combo boxes are visable. I need specific ones to
hide each time I go to a new record.

'Open Form full size
Private Sub Form_Load()
DoCmd.Maximize
End Sub

'Show list of symptomatic
Private Sub cbo_sympto_beforeUpdate(Cancel As Integer)
If cbo_sympto = "Yes" Then
cbo_symp_out.Visible = True
Else
cbo_symp_out.Visible = False

End If
End Sub

Private Sub cbo_risk_BeforeUpdate(Cancel As Integer)
If cbo_risk = "Yes" Then
cbo_risk_out.Visible = True
Else
cbo_risk_out.Visible = False
End If
End Sub

'Private Sub cbo_risk_out_BeforeUpdate(Cancel As Integer)
'If cbo_risk = "Yes" And cbo_risk_out = "Clinically Significant Cardiac
Disease" Then
' cbo_heart_disease.Visible = True
'Else
' cbo_heart_disease.Visible = False
'End If
'End Sub

Private Sub cmd_save_Click()
On Error GoTo Err_cmd_save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmd_save_Click:
'cbo_risk_out.Visible = False
'cbo_symp_out.Visible = False
DoCmd.GoToRecord , , acNext
Exit Sub
Err_cmd_save_Click:
MsgBox Err.Description
Resume Exit_cmd_save_Click

End Sub
Private Sub cmd_exit_Click()
On Error GoTo Err_cmd_exit_Click
DoCmd.Quit
Exit_cmd_exit_Click:
Exit Sub
Err_cmd_exit_Click:
MsgBox Err.Description
Resume Exit_cmd_exit_Click

End Sub
Private Sub cmd_next_Click()
On Error GoTo Err_cmd_next_Click

DoCmd.GoToRecord , , acNext

Exit_cmd_next_Click:
Exit Sub

Err_cmd_next_Click:
MsgBox Err.Description
Resume Exit_cmd_next_Click

End Sub
 
R

ruralguy via AccessMonster.com

Hi Andy,
Put similar code in the Current event of the form. It fires every time you
move to a new record.
 
G

Guest

THANK YOU SOO Much!!!

I assume that I wouldn't need to put any clearing code in the current
because the rest of the form will clear itself, correct?
 
R

ruralguy via AccessMonster.com

Probably but you now know what to do if it doesn't clear.
THANK YOU SOO Much!!!

I assume that I wouldn't need to put any clearing code in the current
because the rest of the form will clear itself, correct?
Hi Andy,
Put similar code in the Current event of the form. It fires every time you
[quoted text clipped - 72 lines]
 
G

Guest

Thank you so much, your a life saver


--
Thanks,
Andy


ruralguy via AccessMonster.com said:
Probably but you now know what to do if it doesn't clear.
THANK YOU SOO Much!!!

I assume that I wouldn't need to put any clearing code in the current
because the rest of the form will clear itself, correct?
Hi Andy,
Put similar code in the Current event of the form. It fires every time you
[quoted text clipped - 72 lines]

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top