Steve R.
Retired
- Local time
- Today, 14:03
- Joined
- Jul 5, 2006
- Messages
- 5,439
The code following works, except for an irritating glitch. List7 is a listbox. As you scroll down the listbox, the underlying form displays the record highlighted by List7. I added an optionbox (Frame33) to provide a filtered list.
The glitch is that it takes two clicks on the same option button instead of one to sync the form to the list box. The first click updates the listbox as expected, but the form itself is not updated. The second click, updates the underlying form.
--------------------------------------------------------------------------
Private Sub Frame33_Click()
Rem Problem with the code requires two clicks to work for unknown reason.
Select Case Frame33
Case 0 'show all records
Me![List7].RowSource = "SELECT [projectnum], [projectname] FROM projectnumqry; "
Case Else 'show limited (filtered) list
Me![List7].RowSource = "SELECT [projectnum], [projectname] FROM projectnumqry where [type]=[frame33];"
End Select
[Text29] = [List7].ListCount - 1
Me![List7].SetFocus
Me.[List7].Selected(1) = True
End Sub
Private Sub List7_Click()
Rem Syncs form to List7. Pulls-up the summary form information for the selected project.
Me.Recordset.FindFirst "[projectnum] = " & Me.[List7]
Call setcontrols
End Sub
The glitch is that it takes two clicks on the same option button instead of one to sync the form to the list box. The first click updates the listbox as expected, but the form itself is not updated. The second click, updates the underlying form.
--------------------------------------------------------------------------
Private Sub Frame33_Click()
Rem Problem with the code requires two clicks to work for unknown reason.
Select Case Frame33
Case 0 'show all records
Me![List7].RowSource = "SELECT [projectnum], [projectname] FROM projectnumqry; "
Case Else 'show limited (filtered) list
Me![List7].RowSource = "SELECT [projectnum], [projectname] FROM projectnumqry where [type]=[frame33];"
End Select
[Text29] = [List7].ListCount - 1
Me![List7].SetFocus
Me.[List7].Selected(1) = True
End Sub
Private Sub List7_Click()
Rem Syncs form to List7. Pulls-up the summary form information for the selected project.
Me.Recordset.FindFirst "[projectnum] = " & Me.[List7]
Call setcontrols
End Sub