problem with textbox value calculation

  • Thread starter Thread starter venulogins
  • Start date Start date
V

venulogins

Guest
Hi frnds,
I am doing reservation system project.in the subform i have 2 textboxes one for no of tickests and one for amount owed. I wll enter the no of tickets and the amount will be calculated with code got focused of amount owed field, my problem is when i go back and change the no of tickets value the amount owed value is not changing to the new amount.the code is as fallows:

Private Sub Tickets_GotFocus()

SendKeys "^(')"
If IsNull(Me.Tickets) Then
Me.Tickets = 1
End If

End Sub

Private Sub Amount_Owed_GotFocus()
Dim TicketPrice As Currency


If IsNull(Me.Amount_Owed) Then
TicketPrice = DLookup("[TicketPrice]", "tblBreakfasts", "[Breakfast] = '" & Me.Breakfast & "'")

Me.Amount_Owed = Me.Tickets * TicketPrice

End If

End Sub

The project due in a week so please help , any sort of help is greatly appreciated.

If i'm not clear at any point above plz let me know

waiting for ur reply
thanking u
chinna
 
Why are you using the GotFocus event instead of Change and/or AfterUpdate? Or perhaps you could make a separate sub and use all of the events to run the sub?
 

Users who are viewing this thread

Back
Top Bottom