Ive had search around the forum and have found a few threads about this but cant pin it to anything that Im doing.
The error occurs when I choose from a combobox after having chosen a record from a listbox and then choose the same record again from the listbox and then choose from the combobox again.
This is the code for the listbox:
And this is the code for the combobox:
Could someone help meout please?
The error occurs when I choose from a combobox after having chosen a record from a listbox and then choose the same record again from the listbox and then choose from the combobox again.
This is the code for the listbox:
Code:
Private Sub List45_AfterUpdate()
On Error GoTo List45_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[DogID] = " & "'" & Screen.ActiveControl & "'"
If Me.Discipline = "Detection" Then
Me.Detection.Visible = True
Me.GP.Visible = False
Else
Me.Detection.Visible = False
Me.GP.Visible = True
End If
List45_AfterUpdate_Exit:
Exit Sub
List45_AfterUpdate_Err:
MsgBox Error$
Resume List45_AfterUpdate_Exit
End Sub
And this is the code for the combobox:
Code:
Private Sub Discipline_BeforeUpdate(Cancel As Integer)
If Me.Discipline = "GP" Then
Me.GP.Visible = True
Me.Detection.Visible = False
Else
Me.Detection.Visible = True
Me.GP.Visible = False
End If
End Sub
Could someone help meout please?