Need to make a command button enter a specific word into a field

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

Here is my scenario. I have a database that is being used for entering
customer appointments and information. Instead of allowing my (trusting)
employees to delete an entry, I want a button that simply enters the word
"Cancelled" into the InvoiceNumber Field.

I track open customers by determining if this field is Null or not. Once an
invoice is entered I know the job is done.

Not sure if I should be using a Macro or a Query. Or if I should just be
using an expression.

Your help is appreciated
 
Hi Kevin,

rather than putting information where it does not belong, consider
another field to track the status. I often put this field into tables:

IsActive, yes/no, DefaultValue=True

then, you can put this code on your command button:

'~~~~~~~~~~
me.IsActive = false
'~~~~~~~~~~

If you have more than one kind of status (maybe you distinguish, for
instance, between Canceled by Customer, or Canceled because items could
not be acquired, or ...

In that case, it would be good to have a table for InvoiceStatus and use
a numeric foreign key to relate to that in your Invoice table.


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*
 
I appreciate the help from both of you. I went with the command button using
Me.InvoiceNumber = "Cancelled"

This is because the way I have designed my database so far is that as long
as the InvoiceNumber is Null, it is considered open. I didn't want to have to
reconfigure all my forms to use an isactive command.
 

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