List Box Double Click event decreasing numbers

Firefly

Registered User.
Local time
Yesterday, 20:33
Joined
Jun 4, 2007
Messages
11
Hey everybody i want to know if theres a way to decrease numbers in a list box after a double click event. Here is a detail of my project.


i have the following in a text box called txtAuthorization on a form called frmcharges on the double click event

Private Sub txtAuthorization_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAuthorizationSearchChargeFormList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

when user double click the text box called txtAuthorization it opens a form called frmAuthorizationSearchChargeFormList which is a list box called list0 with the following in the row source

SELECT qryAuthorizationSearch.AuthorizationID, qryAuthorizationSearch.PersonID, qryAuthorizationSearch.InsuranceName, qryAuthorizationSearch.[Authorization#], qryAuthorizationSearch.SessionsAllowed, qryAuthorizationSearch.StartDate, qryAuthorizationSearch.EndDate, qryAuthorizationSearch.Used, qryAuthorizationSearch.Left
FROM qryAuthorizationSearch;

the following code is in the list box on double click event frmAuthorizationSearchChargeFormList so user can double click the authorization number and insert that into the text box called txtAuthorization on the form called charges


Private Sub List0_DblClick(Cancel As Integer)
With Forms!frmCharges

!txtAuthorization = Me.List0.Column(3)
DoCmd.Close

End With
End Sub


Now this is what i want to do if you take a look at the query on the form called frmAuthorizationSearchChargeFormList we have the following

qryAuthorizationSearch.SessionsAllowed
qryAuthorizationSearch.Used
qryAuthorizationSearch.Left


lets say there are 10 sessions allowed for that authorization number when user double click the authorization number in the list box I want sessions allowed to decrease by one used will be 1 and left will be 9 and so forth u see where i'm going but dont know how to do this

Also lets say user decides to cancell the charges on the form called frmcharges in that case i want the authorization form to reset


Any Ideas


Thank in advance
 

Users who are viewing this thread

Back
Top Bottom