Bill - Changing a property via code is only temporary. If the form is closed the change is dismissed. If you are storing the selection in a table you could use DLookup() during the form's Load event to recall that value and hide or expose the control just like you do in the AfterUpdate event.
---In MS_Access_Professionals@yahoogroups.com, <Bill.Singer@at-group.net> wrote :
I have a combo box in which the user selects and options. Depending on the option, additional fields show up on the form. The combo box stores a value in a table, which is used later in a report. The code is below. It works fine during the initial form completion. However if I close the form and reopen it, the correct field do not show up. Do I have to also put this code in the From "On Current Event"? What if I have a few of these on one form, do I have to put code for all of them in the form "On Current" event?
Here is the code.
Private Sub cboOtherCoverage_AfterUpdate()
If cboOtherCoverage = 1 Then
Me.HelNameOfOtherCoverage.Visible = True
Else: Me.HelNameOfOtherCoverage.Visible = False
End If
End Sub
Bill
Bill Singer
Access 365
Minnesota
Posted by: wrmosca@comcast.net
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar