SetValue Macros

E

erinM

I have created a databse for invoices. I am trying to set up a macro that, on
click, will print the current invoice, set the "Date Printed" field to todays
date, and set the "Printed" field to yes. The "Printed" field is a yes/no
field, and it has a checkbox when viewed on the form. Can anyone help me out
on this. Thanks!
 
S

Steve Schapel

Erin,

Make an Update Query to update your Date Printed field to Date(). Then use
an OpenQuery action in your macro to run the update.

The Printed field is a waste of time, and should be removed from your table.
If there is an entry in the Date Printed field, then you know it has been
printed, so recording this information redundantly in another field serves
no database purpose.
 
B

Barry

I am trying something similar...I created a macro to update a value in a
subform (On Click event) based on the value seleted in a combo box (Master
Link) in a form. The problem I can't figure out is why the value in the
combo box (based on an update table) changes to null if there is no
corresponding record in the subform (table with duplicate values). This is
creating a problem when the macro runs because the combo box value is null.
 
S

Steve Schapel

Barry,

If you can supply the details of your macro, someone may be able to spot
what is going on.

Also, you mention the Click event, but... the Click event of what?

Also, I don't understand the meaning of "update table". What is the Row
Source of the combobox?
 
B

Barry

Sorry Steve,

the click event is the "On Click" property that points (builds) the macro
for the subform object (this is what I would like to click in, select, and be
forced to select the same value as what is visible/selected in the combo box
on the main form). By "update table", I am only specifying that the values
in the combo box are derived from an update table (basically a text field in
a table, updated from an external db source). - Thanks
 
S

Steve Schapel

Barry,

In my experience, the Click event of a subform would be a very unusual way
to proceed.

If you can supply the details of your macro, someone may be able to spot
what is going on.
 

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