Pop up warning after data entry

  • Thread starter Thread starter shell8923 via AccessMonster.com
  • Start date Start date
S

shell8923 via AccessMonster.com

I have a data entry form used for tracking sales. The user will enter the
customers Last Name, First Name, Address, etc. I also have a "Bad Check"
table listing names and addresses of people from whom we cannot accept checks.
If the name of someone in the "Bad Check" table is entered into the data
entry form, I need a warning to pop up telling the user not to accept a check
from this customer. Help!

Thanks.
 
In the AfterUpdate event of your form, use the DLookup function, something
like this:

If DLookup("SomeField","BadCheckTable","[CustId] = " & Me.CustId) <>"" Then
Msgbox "This is a bad hombre. Don't take a check.",vbOkOnly
End If

Look in help for more details on the DLookup function.

HTH,
Barry
 
Thank you! Most helpful - I didn't even think of that. Can I put this
function in the AfterUpdate event after only the name is entered?

Barry said:
In the AfterUpdate event of your form, use the DLookup function, something
like this:

If DLookup("SomeField","BadCheckTable","[CustId] = " & Me.CustId) <>"" Then
Msgbox "This is a bad hombre. Don't take a check.",vbOkOnly
End If

Look in help for more details on the DLookup function.

HTH,
Barry
I have a data entry form used for tracking sales. The user will enter the
customers Last Name, First Name, Address, etc. I also have a "Bad Check"
[quoted text clipped - 4 lines]
 
Sure. Each control has an AfterUpdate event. If you want to prevent a user
from entering a customer that's in the bad check table, you can use the
BeforeUPdate event, which let's you prevent/cancel the update.

Barry

shell8923 via AccessMonster.com said:
Thank you! Most helpful - I didn't even think of that. Can I put this
function in the AfterUpdate event after only the name is entered?

Barry said:
In the AfterUpdate event of your form, use the DLookup function, something
like this:

If DLookup("SomeField","BadCheckTable","[CustId] = " & Me.CustId) <>"" Then
Msgbox "This is a bad hombre. Don't take a check.",vbOkOnly
End If

Look in help for more details on the DLookup function.

HTH,
Barry
I have a data entry form used for tracking sales. The user will enter the
customers Last Name, First Name, Address, etc. I also have a "Bad Check"
[quoted text clipped - 4 lines]
 
Back
Top