Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRunning executables from VB Pin
Programmer_Chris5-Dec-04 5:29
Programmer_Chris5-Dec-04 5:29 
GeneralRe: Running executables from VB Pin
jlawren75-Dec-04 6:23
jlawren75-Dec-04 6:23 
GeneralRe: Running executables from VB Pin
Member 15546336-Dec-04 13:24
Member 15546336-Dec-04 13:24 
GeneralRe: Running executables from VB Pin
Dave Kreskowiak6-Dec-04 3:56
mveDave Kreskowiak6-Dec-04 3:56 
GeneralRe: Running executables from VB Pin
Programmer_Chris6-Dec-04 6:29
Programmer_Chris6-Dec-04 6:29 
GeneralRe: Running executables from VB Pin
Dave Kreskowiak6-Dec-04 7:34
mveDave Kreskowiak6-Dec-04 7:34 
GeneralRe: Running executables from VB Pin
Programmer_Chris6-Dec-04 7:52
Programmer_Chris6-Dec-04 7:52 
General2 Questions in VB6 Code Pin
jlawren75-Dec-04 4:40
jlawren75-Dec-04 4:40 
hi all ihave 2 questions

# 1 I have a application that allows users toswipe their ID badge to log them into or out of a system. problem is, i put this code into the text_Change () event. which works fine. BUT if the user forgets their badge, i also have it set up to allow them to enter a password so they can manually log their selves in or out. the app won't take the password because of the text_Change() event. how can i work around this?

# 2 if the ser swipes their card, and answers NO to the first message box
and YES to the second, ( i have to have th second nag msgbox,to be sur the user didn't mess up)the code follows correctly it then goes to a function tha strips the delimitting chars. when it comes back, it doesn't return to the code spot it left off at. it returns to the beginning of the text_Change () Event and re-tests the value in te textbox. but if does retain te value of the textbox, and it flashes the message Wrong messagebox (see below)
here are the order of events with a card swipe.

1 checks te string for chars.
2 asks if user is logging In?
3 if user answers NO and then YES to the next message box
4 goes to replace charaters Function
5 returns to the top of the event
6 tests the txtPassword again ? <--- why?
7 goes to the "message Wrong "
8 returns to where it left off in the code after it left to the function
9 continues to log te user out

the app needs to allow a card swipe and a manual password entered i would like to keep the card swipe automation if possible or do i have to put this into a click Event and forget about te auto card deal?
here is the code from the text_Change()Event
<br />
Private Sub txtPassword_Change()<br />
<br />
'test the input from the user to see if tey swiped their card correctly<br />
 If Left(txtPassword, 1) = ";" And Right(txtPassword, 1) = "?" Then<br />
         <br />
         Dim cardID As String<br />
            Dim X As Integer<br />
            ' x is te user response to the message box<br />
            X = MsgBox("Are you logging In ?", vbYesNo) Question 1<br />
           <br />
            If X = 6 Then<br />
                Load frmCardLogIn<br />
                cardID = txtPassword.Text<br />
                frmCardLogIn.txtPassId.Text = cardID<br />
                frmCardLogIn.LogOutBtn.Visible = False<br />
                frmCardLogIn.Label2.Visible = False<br />
                frmCardLogIn.Show<br />
                Unload Me<br />
               <br />
            Else<br />
                'If X = 7 Then<br />
                Dim Y As Integer ' y is the answer to the message question<br />
                Y = MsgBox("Are you sure your logging Out?", vbYesNo)Question 2<br />
                If Y = 6 Then<br />
                    txtPassword = ReplaceCharacters(txtPassword, txtUnwanted.Text, txtRepl.Text)<br />
                    Dim SearchSQlPassID As Integer<br />
                    SearchSQlPassID = txtPassword<br />
                    Dim Cnxn As ADODB.Connection<br />
                    Dim cmdChange As ADODB.Command<br />
                    Dim strSQLUpdate, strCnxn, LName As String<br />
                    Dim Now As Date<br />
                    Now = Format(Now, vbLongTime)<br />
                    ' define strSQLUpdate to update the fields<br />
                    strSQLUpdate = "UPDATE Users SET Time_Out = Now WHERE PassID = " & SearchSQlPassID & " AND (Today_Date)= Date()"<br />
                    'open Connection<br />
                    strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\RMSC LOGIN\MYDataBase.mdb;Persist Security Info=False"<br />
                    Set Cnxn = New ADODB.Connection<br />
                    Cnxn.Open strCnxn<br />
                    Set cmdChange = New ADODB.Command  ' Create command object<br />
                    Set cmdChange.ActiveConnection = Cnxn<br />
                    cmdChange.CommandText = strSQLUpdate<br />
                    cmdChange.Execute   ' execute the SQL command<br />
                    Cnxn.Close  ' Close everything<br />
                    Set Cnxn = Nothing<br />
                    Close<br />
                    frmWait.Show 1<br />
                    MsgBox ("You Sucessfully logged yourself Out! Enjoy your day")Message OK<br />
                    Unload Me<br />
                    Load frmStart<br />
                    frmStart.Show<br />
                Else<br />
                    Unload Me<br />
                    Load frmStart<br />
                    frmStart.Show<br />
             End If<br />
            End If<br />
    <br />
 Else<br />
    'check for correct password<br />
    If txtPassword = "****" Then<br />
        Load frmStart<br />
        LoginSucceeded = True<br />
        txtPassword.Text = ""<br />
        frmStart.Show<br />
        Unload Me<br />
        <br />
   Else<br />
        ' tell them they are wrong<br />
        MsgBox ("You need to enter the correct password or swipe your RMSC ID card to continue")Message Wrong<br />
<br />
        txtPassword.SetFocus<br />
         SendKeys "{Home}+{End}"<br />
   End If<br />
End If<br />
End Sub<br />


Help is great only if you ask correctly Smile | :) Big Grin | :-D
GeneralRuntime Error 430 Pin
sathiyaram5-Dec-04 1:30
sathiyaram5-Dec-04 1:30 
GeneralRe: Runtime Error 430 Pin
Mekong River5-Dec-04 3:10
Mekong River5-Dec-04 3:10 
GeneralRe: Runtime Error 430 Pin
sathiyaram5-Dec-04 20:34
sathiyaram5-Dec-04 20:34 
Generalrunning a vb.net program on another comp Pin
mixsa4-Dec-04 22:37
sussmixsa4-Dec-04 22:37 
GeneralRe: running a vb.net program on another comp Pin
Dave Kreskowiak5-Dec-04 3:03
mveDave Kreskowiak5-Dec-04 3:03 
GeneralRe: running a vb.net program on another comp Pin
Mekong River5-Dec-04 3:13
Mekong River5-Dec-04 3:13 
Generalpocket pc problem Pin
Ali Usman4-Dec-04 15:34
Ali Usman4-Dec-04 15:34 
GeneralRe: pocket pc problem Pin
Mitch F.4-Dec-04 15:54
Mitch F.4-Dec-04 15:54 
GeneralRe: pocket pc problem Pin
Dave Kreskowiak5-Dec-04 3:02
mveDave Kreskowiak5-Dec-04 3:02 
GeneralRe: pocket pc problem Pin
Mekong River5-Dec-04 3:23
Mekong River5-Dec-04 3:23 
GeneralAllowing Certain Keys Only Pin
Mitch F.4-Dec-04 14:03
Mitch F.4-Dec-04 14:03 
GeneralPrint Preview &quot;print button&quot; select printer Pin
crsimmons4-Dec-04 6:23
crsimmons4-Dec-04 6:23 
GeneralRe: Print Preview &quot;print button&quot; select printer Pin
crsimmons5-Dec-04 2:53
crsimmons5-Dec-04 2:53 
QuestionHow can I cocnect TCP/IP to the Server? Pin
ATC4-Dec-04 4:14
ATC4-Dec-04 4:14 
Generaltroubles with MS.Access &amp; ASP.NET. Pin
gamerPotatoe4-Dec-04 0:09
gamerPotatoe4-Dec-04 0:09 
GeneralRe: troubles with MS.Access &amp; ASP.NET. Pin
Mekong River5-Dec-04 3:29
Mekong River5-Dec-04 3:29 
GeneralCRystal Report Pin
nitin_ion3-Dec-04 18:04
nitin_ion3-Dec-04 18:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.