|
-
Jan 9th, 2002, 09:52 AM
#1
Thread Starter
Member
How do I refresh a page?
I'm working on a program that has a catalogue and a basket that users can fill up. I have one form that displays all items in the basket. The user can click on a certain item, then on remove to take an item ut of the basket. I would like to refresh the page so that after clicking on 'remove', the list of items in the basket is automatically updated. I tried using Me.Refresh, but this doesn't work. Is there something else I can do?
Here's what I've done:
Private Sub cmdRemoveItem_Click()
x = lbItemNum(Index)
eraseItem x
End Sub
Private Sub eraseItem(ByVal itemNum As Long)
Dim i As Long
For i = itemNum To UBound(cart) - 1
cart(i) = cart(i + 1)
Next
ReDim Preserve cart(UBound(cart) - 1)
z% = UBound(cart)
End Sub
This is the code that fills in the labels :
Private Sub Form_Load()
tot = 0 'remet tot à 0 à chaque affichage de la page au cas ou erase à été appelé
' doit faire gestion de pages (+ que 10 articles)
If Not z% = 0 Then 'voir panier vide
For y% = 0 To (z% - 1)
lbNum(y%).Caption = y% + 1
lbItemNum(y%).Caption = Str$(cart(y%).itemNum)
lbItemName(y%).Caption = cart(y%).ItemName
lbPrice(y%).Caption = CStr("$ " & cart(y%).Price)
lbColor(y%).Caption = cart(y%).Color
lbSize(y%).Caption = cart(y%).Size
lbQty(y%).Caption = cart(y%).Nbr
lbItemTot(y%).Caption = CStr("$ " & cart(y%).ItemTot)
tot = tot + cart(y%).ItemTot
Next y%
lbSubTot = CStr("$" & tot)
End If
End Sub
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
|