i have a form to enter where the user enters in 4 seperate pieces of information about the dvd into 4 seperate text boxes, then a save button which saves it all to an array. this works fine but on the main form where the information is displayed i cant get the previous and next buttons to go to the next or previous information in the array without getting some form of error after a few clicks. when the next button is clicked it shows the first set of information in the array fine and can keep going round the array, but when i click the previous button and then use the next button again i get an error.
i was wondering if anyone could help me with this as ive tried near enough everything and i know it will probably be a small error or missed out bit of code.
the code is:
NEXT BUTTON sub =
If counter > numdvds - 1 Then
counter = 0
End If
With Details(counter)
TxtTitle.Text = .Title
TxtDirector.Text = .Director
TxtYear.Text = .Year
TxtRating.Text = .Rating
PBoximage.ImageLocation = .dvdimage
End With
counter = counter + 1
PREVIOUS BUTTON sub =
If counter < 0 Then
counter = numdvds - 1
End If
With Details(counter)
TxtTitle.Text = .Title
TxtDirector.Text = .Director
TxtYear.Text = .Year
TxtRating.Text = .Rating
PBoximage.ImageLocation = .dvdimage
End With
counter = counter - 1
just wondering if theres any other way i could do it to make it work correctly? would really appreciate any help. thanks