Fill from combo field

tjones

Registered User.
Local time
Today, 03:17
Joined
Jan 17, 2012
Messages
199
I have the correct fields showing and hiding based on the selection in a checkbox. The problem is that I would like to use the same address fields
When the checkbox is yes they fill from the University combo field, but when the
checkbox is no, they are open for entry. The code is:

Private Sub UniversityID_AfterUpdate()
'when UniversityID check box is yes then the university fields show
If Me.UniversityID = 1 Then
Me.Organization.Visible = False
Me.University.Visible = True
Me.Address.Visible = True
Me.City.Visible = True
Me.State.Visible = True
Me.ZIP.Visible = True
Me.Country_Region.Visible = True
Me.AddUni.Visible = True
End If
'When the UniversityID check box is 1 then fill address from university combo
If Me.UniversityID = 1 Then
Me.Address = [University].[Column](2)
Me.City = [University].[Column](3)
Me.State = [University].[Column](4)
Me.ZIP = [University].[Column](5)
Me.Country_Region = [University].[Column](6)
End If
'when UniversityID check box is no then the organization fields show
If Me.UniversityID = 2 Then
Me.University.Visible = False
Me.AddUni.Visible = False
Me.Organization.Visible = True
Me.Address.Visible = True
Me.City.Visible = True
Me.State.Visible = True
Me.ZIP.Visible = True
Me.Country_Region.Visible = True
End If
End Sub
 
Figured out how this works. The code for auto updating the fields if "UniversityID" was yes needed to go under the University field after update and not the yes/no UniID field.
 

Users who are viewing this thread

Back
Top Bottom