Welcome to Dream.In.Code
Become a VB Expert!

Join 137,265 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,508 people online right now. Registration is fast and FREE... Join Now!




HELP WITH THIS PROGRAM

 
Reply to this topicStart new topic

HELP WITH THIS PROGRAM, anyone offer any help??

john3000
12 Dec, 2006 - 09:55 AM
Post #1

New D.I.C Head
*

Joined: 12 Dec, 2006
Posts: 1


My Contributions
ok this is the task that i am wishing to do ::

Create a program that will ask user to enter their ID and this id will be checked and verified.the IDs will already be stored on the computer and only need to be checked

CODE
Private Sub cmdstart_Click()
Dim Valid_ID(5) As Variant


Valid_ID(1) = WallaceW468P01
Valid_ID(2) = LauderH468P02
Valid_ID(3) = CarnegieA468P03
Valid_ID(4) = ScottW468P04
Valid_ID(5) = DeBruisR468P05







End Sub



that is all i can do , im not sure of the rest can some one plz help me out ???? i only know that a liner search must be used but i dont no how to do one.

This post has been edited by john3000: 12 Dec, 2006 - 09:57 AM
User is offlineProfile CardPM
+Quote Post

Mach1Guy
RE: HELP WITH THIS PROGRAM
12 Dec, 2006 - 12:23 PM
Post #2

D.I.C Head
Group Icon

Joined: 4 Dec, 2006
Posts: 79



Thanked: 4 times
Dream Kudos: 25
My Contributions
Not sure what exactly you want here. You should probably have a textbox on the form for the user's input and a 'Submit' button.

Code to store value from textbox
CODE

Dim strUserID As String

strUserID = txtUser.Text


Here is code that will prompt for the user's input
CODE

Dim message, title As String

' Set prompt.
message = "Enter your ID"
' Set title.
title = "Enter ID"

' Display message, title, and default value.
myValue = InputBox(message, title)


You could use a series of If statements or a Case for checking if the user input matches on of the predefined IDs. Let me know if this is what your looking for.

I guess if your storing the IDs in an array you would probably want to use a loop around an If statement
User is offlineProfile CardPM
+Quote Post

Dalit
RE: HELP WITH THIS PROGRAM
12 Dec, 2006 - 02:41 PM
Post #3

D.I.C Head
**

Joined: 24 Jan, 2006
Posts: 54


My Contributions
Here's what you need to do.

1st Sub routine
Dim variables/arrays
Call createarray subroutine
Do
Call checkID/bookseat/display results sub routine
Prompt for exit
Loop until

Private Sub createarray
ids(0) = "WallaceW48P01"
ids(1) = "LauderH468P02"
etc..
Flightnr = "HA468"
End Sub

Private Sub checkid
Dim vairables
Input validation/linear search should look like this
CODE
Do
  
     For counter = 0 To 4
        If ids(counter) = pasid Then
        found = True
        MsgBox ("The ID you was accepted")
    
        If Not found Then MsgBox ("The ID you entered was invalid")
        Else
        End If
    Next
  Loop Until found = True

End Sub

Private Sub book seat
same as above but with more input validation
End Sub

Private Sub display results
lstbox.AddItem = "stuff here"
End Sub

That's it really. What school do you go to? I just finished writing this program

This post has been edited by Dalit: 12 Dec, 2006 - 02:53 PM
User is offlineProfile CardPM
+Quote Post

KKKKK
RE: HELP WITH THIS PROGRAM
17 Feb, 2007 - 10:43 AM
Post #4

New D.I.C Head
*

Joined: 16 Feb, 2007
Posts: 15


My Contributions
Can you post the finished code I cant do this program need help.
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: HELP WITH THIS PROGRAM
17 Feb, 2007 - 10:45 AM
Post #5

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 14,972



Thanked: 48 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
KKKKK, you can post your question in a new topic and post what you've done so far, but we can't just provide you the code. Please take a moment to read over the forum rules: http://www.dreamincode.net/forums/showtopic13280.htm
User is online!Profile CardPM
+Quote Post

KKKKK
RE: HELP WITH THIS PROGRAM
17 Feb, 2007 - 11:38 AM
Post #6

New D.I.C Head
*

Joined: 16 Feb, 2007
Posts: 15


My Contributions
Ok thanks will do, have to copy from computer to computer first thats why I asked will be up ASAP.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:26PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month