Refresh a column

Diana Avila

Registered User.
Local time
Today, 05:06
Joined
Jul 13, 2011
Messages
17
Hi there!!!!

I don't even now if this can be done :confused: I wish someone out there could help me.

I need a column from my table to reset it's value to zero after saving changes or before closing it.
 
That sounds a bit strange to me. Can you provide a little more information? Why would a column be reset to zero after saving changes? That is one contradictory statement there.

As for the other part - before closing it - are you working in the table directly or from a form bound to the table? If working in the table directly, tables have no events so you have virtually no control over things whatsoever. People should not be working in tables or queries directly as you cannot control much at all with those. Forms are for interfacing with tables and queries and then you have events which then can give you some control.
 
Hi there!!!

You are right that was contradictory. I'll explain it better

I have a table with a list of products. Like figure 1 shows.
I also have a form that works with the information from the table. Like figure 2 shows.
At last I have a macro that filters only the products that have more than 1 item in the "Cantidad" column. Like figure 3 shows

The idea is that the user opens the table, chooses the items to be printed by typing a number in the "Cantidad" column, then goes to the macro and print it. Like last picture.

But i need the "Cantidad" column to have it's fields in zero for the next time a user opens it.

I hope I have explained it better Thanks 4 the time!!!!
As I wrote before. Don't know if it can be done :(
 

Attachments

  • table_forum.jpg
    table_forum.jpg
    110.1 KB · Views: 99
  • form_forum.jpg
    form_forum.jpg
    94.7 KB · Views: 98
  • macro_forum.jpg
    macro_forum.jpg
    37.9 KB · Views: 91
  • sheet_2_print.jpg
    sheet_2_print.jpg
    31.9 KB · Views: 99
Okay, that makes a WHOLE lot more sense now. Create an update query:

Update Products Set Cantidad = 0

and run that from the form's Close event:

CurrentDb.Execute "Update Products Set Cantidad = 0" , dbFailOnError
 
Hi!!!

I did the query part and it worked out perfectly. But i must have done something wrong in the form properties (picture1) because it displays me this message everytime i try to close it :s (picture2) Then when i click on the "debug" button it shows (picture3) and then i don't know how to fix it

Sorry, as you may have noticed I'm really new at this :o

I also attached the update query Thanks for the help :)
 

Attachments

  • property_sheet_forum.jpg
    property_sheet_forum.jpg
    67.8 KB · Views: 101
  • error_forum.jpg
    error_forum.jpg
    9.6 KB · Views: 92
  • updatedata_forum.jpg
    updatedata_forum.jpg
    46.2 KB · Views: 93
  • updatequery_forum.jpg
    updatequery_forum.jpg
    14.6 KB · Views: 89
Yes, you did - the code should be:

CurrentDb.Execute "updatedata", dbFailOnError


the actual word CurrentDb is the word to use, not the name of the database.
 

Users who are viewing this thread

Back
Top Bottom