G
Guest
hello again everyone,
ive spent a while trying to figure this out, no luck so far and im on a time
limit (as everyone else i guess) so i dont have much more time to sort this.
My combo box on a form allows me to pick a value and does all the
calculations ive written in a VBA sub exectue perfectly but then when i try
to pick another value on it, it makes a little noise and nothing happens, i
can move around the rest of the form just fine but i cant amend that value
ive set.
It doesnt even seem to call the event when i try clicking on it again! it
just makes a litle ping noise!
However when i take some code of the VBA i notice that i can change the
value but its now not running the caluclations in the background that i need.
ive inserted in the vba code below, if you spot anything in it then id
really appreciate any ideas.
Private Sub PayOption_Click()
Me![Payment1] = Me![weeks1]
Me![Payment2] = Me![weeks2]
Me![Payment3] = Me![weeks3]
Me![Payment4] = Me![weeks4]
'when i take this if statement out then it works just fine
If Not IsNull(Me![Duration]) And Not IsNull(Me![Discount]) And Not
IsNull(Me![WeeklyRent]) Then
POption = Me![PayOption]
weeks = Me![Duration]
WeeklyRent = Me![WeeklyRent]
Discount = Me![Discount]
'calculates the rent without any discount
Me![rentalPayment] = weeks * WeeklyRent
'calls the function to calculate the total rent based on the option
number
Me![DiscountedRentalPayment] = weeks * WeeklyRent * Discount
Else
Exit Sub
End If
End Sub
with much thanks
Amit
ive spent a while trying to figure this out, no luck so far and im on a time
limit (as everyone else i guess) so i dont have much more time to sort this.
My combo box on a form allows me to pick a value and does all the
calculations ive written in a VBA sub exectue perfectly but then when i try
to pick another value on it, it makes a little noise and nothing happens, i
can move around the rest of the form just fine but i cant amend that value
ive set.
It doesnt even seem to call the event when i try clicking on it again! it
just makes a litle ping noise!
However when i take some code of the VBA i notice that i can change the
value but its now not running the caluclations in the background that i need.
ive inserted in the vba code below, if you spot anything in it then id
really appreciate any ideas.
Private Sub PayOption_Click()
Me![Payment1] = Me![weeks1]
Me![Payment2] = Me![weeks2]
Me![Payment3] = Me![weeks3]
Me![Payment4] = Me![weeks4]
'when i take this if statement out then it works just fine
If Not IsNull(Me![Duration]) And Not IsNull(Me![Discount]) And Not
IsNull(Me![WeeklyRent]) Then
POption = Me![PayOption]
weeks = Me![Duration]
WeeklyRent = Me![WeeklyRent]
Discount = Me![Discount]
'calculates the rent without any discount
Me![rentalPayment] = weeks * WeeklyRent
'calls the function to calculate the total rent based on the option
number
Me![DiscountedRentalPayment] = weeks * WeeklyRent * Discount
Else
Exit Sub
End If
End Sub
with much thanks
Amit