Change a record, update field

G

Guest

Hello,

I have the following:

INPUT_NUMBER: input a number
DN: True if Area_Code merged with INPUT_NUMBER are found in DN tbl

Sometimes Area_Code and/or INPUT_NUMBER needs to be changed on the fly. I
need to check on the fly if the new number, e.g. Area_Code merged with
INPUT_NUMBER, are in the DN tbl. If found, I need to automatically update
the DN for that record to immediately change from False to True. (This would
cause a conditional formatting to disable several controls so the client is
not called).

I am attempting this via macros and OpenQueries, but it appears once the
form is opened, I can not force the form to recheck the tbl to see if DN has
changed, thus the client could be in the DN list and staff would call the
client when they should not have called him.

How can I make a changing of this number force a macro (or whatever may be
best) to update the tbl and force the opened form to "see" the change in DN,
thus, preventing an unnecessary call?

Thanks
 
S

Steve Schapel

Rod,

It seems to me that you could use a SetValue action in your macro that
is triggered on the AfterUpdate event of both the Area_Code and
INPUT_NUMBER controls. Arguments would be like this...
Item: [DN]
Expression: -1

It may then be a good idea to have a RunCommand/SaveRecord action in the
macro.

You may then need to use a RunCommand/Refresh action to get the
Conditional Formatting to update the display.

Let us know whether that helps...
 
G

Guest

The problem I have is I do not know if the newly inputted number is in the DN
tbl, so I do not know what to set it to. I need to execute a lookup in the
DN tble to see if the newly inputted number is in the DN tble. If found, I
need to set the value, else I need to clear the value.

Thoughts...

Steve Schapel said:
Rod,

It seems to me that you could use a SetValue action in your macro that
is triggered on the AfterUpdate event of both the Area_Code and
INPUT_NUMBER controls. Arguments would be like this...
Item: [DN]
Expression: -1

It may then be a good idea to have a RunCommand/SaveRecord action in the
macro.

You may then need to use a RunCommand/Refresh action to get the
Conditional Formatting to update the display.

Let us know whether that helps...

--
Steve Schapel, Microsoft Access MVP
Hello,

I have the following:

INPUT_NUMBER: input a number
DN: True if Area_Code merged with INPUT_NUMBER are found in DN tbl

Sometimes Area_Code and/or INPUT_NUMBER needs to be changed on the fly. I
need to check on the fly if the new number, e.g. Area_Code merged with
INPUT_NUMBER, are in the DN tbl. If found, I need to automatically update
the DN for that record to immediately change from False to True. (This would
cause a conditional formatting to disable several controls so the client is
not called).

I am attempting this via macros and OpenQueries, but it appears once the
form is opened, I can not force the form to recheck the tbl to see if DN has
changed, thus the client could be in the DN list and staff would call the
client when they should not have called him.

How can I make a changing of this number force a macro (or whatever may be
best) to update the tbl and force the opened form to "see" the change in DN,
thus, preventing an unnecessary call?

Thanks
 
G

Guest

Rod,

Try putting a Requery in your macro right after you update the table. This
forces the form to read the data from the table again.
 

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