Run-Time error

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
-----------------------------------------------------------
 
S

Sam

Have you tried moving the focus to another control on the
form before requerying the listbox?
 
R

Ryan

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
 
S

Sam

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top