Permanent Data

louisa

Registered User.
Local time
Today, 09:36
Joined
Jan 27, 2010
Messages
262
Hi everyone,

I have a form called "Commission" in that form are two fields one called "Invoiced" and another "TelesalesCommission"
The Invoiced field will have a date entered in to it, what i am hoping for is if the Invoiced field has data entered in it then the TelesalesCommission field should have £40.00 entered into it automatically. Does anybody no if this can be done?
 
Hi Louisa! Yep that should be doable in VBA - depending on when you want the £40 added, all you have to do is use an if in the appropriate event:
Code:
if me.invoiced is not null then
me.telesalescomission.value=40
Else
me.telesalescommision.value=0
Endif
 
Hi James,

Thanks for coming back to me, i keep receiving Run Time Error 424 With "If Me.Invoiced Is Not Null Then" highlighted???

I have tried this in the Forms on load event and the fields on click event and after update :-(
 
Ah that's an object required. Is the control called "Invoiced"? And is the event you've put the code in on the same form as "Invoiced" and "Telesalescommission"?

It might also be because of the is not null. Try changing that to <>""
 
Is Null is a SQL syntax use IsNull for VBA

So
Code:
Private Sub Invoiced_AfterUpdate()
If Not IsNull(Me.Invoiced) Then
   .....
End If
End Sub

JR
 
Nyet problemski. Have a good one!
 

Users who are viewing this thread

Back
Top Bottom