|
-
Mar 13th, 2002, 11:29 AM
#1
Thread Starter
Lively Member
Selecting file data
cboTreatments-(holds treatment and price)
User can select up to 4 treatments and prices.
How can I code so that when the first treatment & price are selected they only populate the 1st lbltreatment and txtprice and then allow me to select a 2nd treatment which populates the 2nd lbltreatment & txtprice etc. Here my code so far.
Private Sub cboTreatment_Click()
Dim TreatmanetDetails As String
TreatmentDetails = cboTreatment.Text
lblTreat1 = Left(TreatmentDetails, 40)
txtCost1 = Right(TreatmentDetails, 6)
lblTreat2 = Left(TreatmentDetails, 40)
txtCost2 = Right(TreatmentDetails, 6)
lblTreat3 = Left(TreatmentDetails, 40)
txtCost3 = Right(TreatmentDetails, 6)
lblTreat4 = Left(TreatmentDetails, 40)
txtCost4 = Right(TreatmentDetails, 6)
txtGross.Text = Val(txtCost1) + (txtCost2) + (txtCost3) + (txtCost4)
End Sub
Thanks in anticipation
Rosi
-
Mar 13th, 2002, 11:54 AM
#2
Does this help? Of course you'd have to make sure all your label captions were empty strings each time you restarted.
VB Code:
If lblTreat1 = "" Then
lblTreat1 = Left(TreatmentDetails, 40)
txtCost1 = Right(TreatmentDetails, 6)
ElseIf lblTreat2 = "" Then
lblTreat2 = Left(TreatmentDetails, 40)
txtCost2 = Right(TreatmentDetails, 6)
Endif
This world is not my home. I'm just passing through.
-
Mar 13th, 2002, 12:29 PM
#3
Thread Starter
Lively Member
Select file data - resolved
Hi trisuglow
Cheers for that code it works a treat
Rosi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|