Run-Time error

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

Whenever I run the attached code I get a run-time
error '2118' message saying that I need to save the
current field before performing a requery. Can anyone
tell me how to get around this error?

Thanks,
Chad
----------------------------------------------------------
Public Sub UpdateResults()
Dim intIndex As Integer
If Forms!frmResults!lstReports.ItemData(intIndex)= _
"STATEWIDE CRIMINAL" Then
Forms!frmResults!tabSC.Visible = True
Forms!frmResults!subfrmSCResults!lstSCResults.Requery
Forms!frmResults!subfrmSCResults!lstSCResults. _
Selected(0) = True
End If
End sub
-----------------------------------------------------------
 
Have you tried moving the focus to another control on the
form before requerying the listbox?
 
I tried that but it didn't work. But just to let you know
I found the answer while searching through some other
newsgroups. I had to set the listbox to Null before
Requerying it. Thanks for your help though

Ryan
 
Yup... you are welcome.
-----Original Message-----
I tried that but it didn't work. But just to let you know
I found the answer while searching through some other
newsgroups. I had to set the listbox to Null before
Requerying it. Thanks for your help though

Ryan
.
 
Back
Top