Hi there!
Im just new so bare with me here...
Right, im having a little trouble with a project here. I need to populate my array, without displaying the information. And then, using an inputbox, validate the ID that is entered. If the ID is entered wrongly, an error message should appear. If it corresponds with one of the stored ID's in my array, it should allow me to proceed to the next step (which is a problem i'll overcome if and when i come to it!)
My coding skills are pretty pathetic. But heres what i got so far...
CODE
Private Sub cmdid_Click()
Dim valid_id(4) As Double
Dim details As Double
Dim i As Integer
valid_id(0) = "WallaceW"
valid_id(1) = "CarnegieA"
valid_id(2) = "ScottW"
valid_id(3) = "LauderJ"
valid_id(4) = "MillsS"
For i = 0 To 4
Do
details = InputBox("Please enter your passenger ID")
If valid_id = "WallaceW" Or valid_id = "CarnegieA" Or valid_id = "ScottW" Or valid_id = "LauderJ" Or valid_id = "MillsS" Then
MsgBox ("Your ID is valid. You must book a seat")
Else
MsgBox ("Your ID is invalid")
End If
Loop Until details = "WallaceW" Or details = "CarnegieA" Or details = "ScottW" Or details = "LauderJ" Or details = "MillsS"
Next
End Sub
I think thats pretty messy coding. But its the best i can do! I keep getting error messages all over the shop, and im just stuck lol.
Thanks.