Hello, I posted the first part of this question in the VBA coding forum and thanks much to FredaH302 for giving me valuable tips (thread705-131554).
However I am having a small problem now where my subforms would show specific records by scrolling the mouse wheel, but when I click on the item in the Combo Box I become editing that field and Access says it would create duplicates (my combo is primary key to the record). Below are my AfterUpdate codes:
Private Sub cboCourseID_AfterUpdate()
On Error GoTo Err_cboCourseID_AfterUpdate
Me.Recordset.Clone.FindFirst "[CourseID] = '" & Me![cboCourseID] & "'"
If Not Me.Recordset.Clone.EOF Then Me.Bookmark = Me.Recordset.Clone.Bookmark
Exit_cboCourseID_AfterUpdate:
Exit Sub
Err_cboCourseID_AfterUpdate:
MsgBox Err.Description
Resume Exit_cboCourseID_AfterUpdate
End Sub
Is there something I should do to make mouse click work? Or am I getting this all wrong?
Thank you for any help.
However I am having a small problem now where my subforms would show specific records by scrolling the mouse wheel, but when I click on the item in the Combo Box I become editing that field and Access says it would create duplicates (my combo is primary key to the record). Below are my AfterUpdate codes:
Private Sub cboCourseID_AfterUpdate()
On Error GoTo Err_cboCourseID_AfterUpdate
Me.Recordset.Clone.FindFirst "[CourseID] = '" & Me![cboCourseID] & "'"
If Not Me.Recordset.Clone.EOF Then Me.Bookmark = Me.Recordset.Clone.Bookmark
Exit_cboCourseID_AfterUpdate:
Exit Sub
Err_cboCourseID_AfterUpdate:
MsgBox Err.Description
Resume Exit_cboCourseID_AfterUpdate
End Sub
Is there something I should do to make mouse click work? Or am I getting this all wrong?
Thank you for any help.