Conditional macro

  • Thread starter Thread starter Bartman
  • Start date Start date
B

Bartman

1. I need to update a build table query for an access database that is
used by multiple users each day.

2.The database needs to be refreshed once at the start of each day.

a> I have created two control boxes one called "then" this holds the
last date that the database was re-freshed. The other control "now"
holds todays date.

b> I was hoping to add this to a conditional macro when the form was
opened that looks at the last updated date "then" and if it is less
than today's date it will run the update table query.

Here is the conditional macro I used that does not seem to work? Any
ideas???

IIf([Forms]![The CS teams search qry 2]![now]>[Forms]![The CS teams
search qry 2]![then],True,False)
 
Put it in the Contion column of the macro without Iif --

[Forms]![The CS teams search qry 2]![now]>[Forms]![The CS teams search qry
2]![then]

You should not use "now" or "then" for object names as Access might confuse
them with reserved words.
 
Thanks Karl,
I will try tomorrow!
So basically you are saying don`t use IFF prefix?

When I say "now" and "then" are objects I mean they are text boxes.
"then" is a max of the date that exists in the table. "now" is a =now()
statement.
So the condition is if todays date is greater than the date in the
table already then update the table using the build table query using a
macro.

Chris
 
Hi Karl,

I tried this as:
[Forms]![The CS teams search qry 2]![now]>[Forms]![The CS teams search
qry 2]![then]

in the conditional macro and it is set to the on load command in the
properties window of the form. As metioned the now text box on the form
is a simple formula =now() and the then text box on the form is a max
of the last update date.

I want the condition to look at now and if it is greater than then to
run a macro to update the table to the latest dates data. The macro I
have is called macro6 and this is the one that updates the table.

The change to the conditional macro did not seem to work?

Regards
Chris
 

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

Back
Top