update yes/no

potts

Registered User.
Local time
Today, 19:33
Joined
Jul 24, 2002
Messages
87
hope someone can help - I've been trying to get this to work for a while with no success.

I have a listbox bound to a query. I then have a command button that prints reports from the records selected in the list box.

All this works fine.

The problem is that I need to update one of the fields in the listbox query from no to yes when the selected records are printed.


Does anyone know how this might be done???
:confused:
 
I'm assuming you are running your report using a dynamically created SQL to populate the Report. Create a separate dynamic Update SQL in the same way then use Docmd.RunSql (I think) to run the SQL. You will need to set warnings off/on around the statement to avoid messaged to the user. I think this will work.
 
complete frustration

I just can't get this to work.

I've tried the RunSQL method, the RunMacro method, the Update method, and a method from a book I got working in ADO.

I'm sure this is something I'm doing wrong, but I just can't see what.

All I want to do is update selected records from no to yes - surely it can't be this hard!!
:( :( :(
 
Use an Update query, you'll have to Requery the listbox to reflect the changes
 
Ok I've got the update query working - sort've!!!

It updates all the records in the underlying table, not just the ones I've highlighted in the listbox.

I've just added the DoCmd.OpenQuery line onto the end of the code that operates the selection of reports to print from the listbox..... is this wrong?
:confused:
 

Users who are viewing this thread

Back
Top Bottom