update query not quite working

B

Boysie

Hi

I am creating an exercise database- really simple- which allows the trainer
to select exercises on a continuous form by ticking a tick box. I have
managed this part fine. I have then tried to create an update query to
deselect all boxes for the next time it is used. However, when i run the
query for some reason the boxes only deselect when I run the mouse over them
or click on the record's row. Im pretty sure this isnt meant to happen - any
ideas????
 
E

ErezM via AccessMonster.com

hi
the form doesnt know about changes to it's data if it didnt happen directly
on it
when you access a row, however, it does retreive the chenge and shows it
if you want to force a refresh, Add
Me.Requery
after the update query runs,
that will rebuild the list with the updated data

Erez
 
B

Boysie

Hi ErezM

thanks for the reply. Im quite a new user to access. Do you mean me to write
'Me.Requery' in the code in design view? If so I've tried your suggestion but
it only deselects everything when I close and then re-open the form?
 
E

ErezM via AccessMonster.com

hello again
if it's a form thats showing the data, then

add a command button named cmdClear

in it's click event add this:

Private Sub cmdClear_Click()
DoCmd.OpenQuery "UpdateQueryNameHere"
Me.Requery
End Sub

this will run your query to clear the check boxes, then requery the form's
data (which means show the cleared checkboxes...)

good luck
Erez
Hi ErezM

thanks for the reply. Im quite a new user to access. Do you mean me to write
'Me.Requery' in the code in design view? If so I've tried your suggestion but
it only deselects everything when I close and then re-open the form?
hi
the form doesnt know about changes to it's data if it didnt happen directly
[quoted text clipped - 16 lines]
 

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

Similar Threads


Top