Link to home
Start Free TrialLog in
Avatar of pcdaveh
pcdaveh

asked on

locked table run-time error 3211

I have a form that has a list box that is populated by a saved query.  I have two text boxes that accept date input and a refresh command button that requeries the table to populate the list box when dates are changed.  When I hit refresh the process is stopped because a the table is locked by the saved query.  How do i get around this problem?
Avatar of PsychoDazey
PsychoDazey

What are your record locks set to on your table?  you may have to set them to no locks.  Also, you should use the requery method rather than the refresh.
Hi pcdaveh,

u can use a sql-statement to populate the listbox.

dim strSQL as string
strSQL = "Select FirstField, SecondField from YourTable where YourDate1 > #" & me.txtbox1 & "# and Yourdate1 < #" & me.txtbox2 & "#;"
me.ListBox.Rowsource = strSQL


clear?

Cheers
Ricky
Avatar of pcdaveh

ASKER

I had previously embedded the SQL statement in the vba code as the row source to the list box.  I received the same errors.
I am thinking you have your record locks option set to All Records.  I believe the table cannot be accessed at all with this option checked, but I've been wrong before and I'm sure I will again...right Ricky :-)
Avatar of pcdaveh

ASKER

I had previously embedded the SQL statement in the vba code as the row source to the list box.  I received the same errors.
lol PsychoDazey, its been a long week for all of us... :-)
(but not for me, i've been home all week, and the next couple of weeks, broke my whrist last saturday  :-(  )

cheers
Ricky
Ouch!  You've got to take it easy on that keyboard!  I broke my wrist before, 4 months in a cast!
dont read tooooo fast, as i'm typing with my left hand only, which is pretty slow.............
Avatar of pcdaveh

ASKER

I'm hanging it up 'til Monday!  Have a good weekend Fellas!
good weekend to u too pcdaveh, and u PsychoDazey,

cheers
Ricky
Same to you all.  Get some rest paurths
any luck pcdaveh?
for pcdaveh

It's time to clean up this TA, so I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
ASKER CERTIFIED SOLUTION
Avatar of ComTech
ComTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial