Edited by HansV to break up very long line
I have a form with 2 multi-select listboxes. The first listbox controls what will be seen in the second.
This part works OK. The problem is that I have a Reset function that resets both listboxes to a default setting.
Private Function Reset() Dim strSQL As String Me.cboRegions = "*" g_Region = "*" Me.cboTech = "*" g_Tech = "*" Me.cboTeam = "*" g_Team = "*" Me.cboTech.Requery Me.cboTeam.Requery Me.cboRegions.Visible = True Me.Regions_Label.Visible = True Me.cboTech.Visible = True Me.TECH_Label.Visible = True Me.cboTeam.Visible = True Me.lstRank = "*" Me.lstRank.SetFocus Me.lstRank.ListIndex = 0 g_Rank = "*" Me.lstChannel = "*" Me.lstChannel.SetFocus Me.lstChannel.ListIndex = 0 g_Channel = "*" Me.lstBrand = "*" Me.lstBrand.SetFocus Me.lstBrand.ListIndex = 0 g_Brand = "*" Me.lstActivity = "*" Me.lstActivity.SetFocus Me.lstActivity.ListIndex = 0 g_ActivityCode = "*" 'code for Result listbox source strSQL = "SELECT tblResultCode.Description FROM tblResultCode " & _ "WHERE ((([tblResultCode].[Activity]) Like '*')) UNION SELECT ' * ' as " & _ "Bogus from tblResultCode;" Me.lstResult.RowSource = strSQL Me.lstResult.Requery Me.lstResult = "*" Me.lstResult.SetFocus 'Line that gets the error Me.lstResult.ListIndex = 0 g_ResultCode = "*" Me.cmdExit.SetFocus End Function
On the line Me.lstResult.SetFocus, I get a message “Access can’t move the focus to the control lstResult.
I tried moving the focus to another item on the form then back with no help.
Scott