Code for Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good day,

how do I code that if a field is empty (Null) then to run a macro.

Here is what I am trying to do,

In a subform I have a dropdown menu (Combo box) that has different machines.
Certain information is required inorder to calculate a rate. Basically, If
the user selects a machine and one of the fields is empty a message box comes
up saying "Incomplete information" otherwise if all the information is there
then it does the caculation.

Hope that makes sense.,

Thanks for your help in advance

Cheers
 
Hi K,

In the after update event of the combo box, have code similar to the
following:

if isnull(me.FIELD1) OR isnull(me.FIELD2) then
msgbox "Incomplete information"
else
CODE TO CALCULATE RATE
endif

where FIELD1 and FIELD2 are fields that can't be null, and the code to
calculate rate is placed in there.

Hope this helps.

Damian.
 
Damian.

Thanks! much appreciated.

Cheers
Kyle.

Damian S said:
Hi K,

In the after update event of the combo box, have code similar to the
following:

if isnull(me.FIELD1) OR isnull(me.FIELD2) then
msgbox "Incomplete information"
else
CODE TO CALCULATE RATE
endif

where FIELD1 and FIELD2 are fields that can't be null, and the code to
calculate rate is placed in there.

Hope this helps.

Damian.
 
Not working here is my code

Private Sub UOM_LostFocus()
IIf [PIECES] = 0, MsgBox("Incomplete Information. Number of PCS/CUT Required
for this process"), PCS_HR = 1


End Sub
 

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