Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. 2 Questions in VB6 Code

2 Questions in VB6 Code

Scheduled Pinned Locked Moved Visual Basic
questiontestingtoolshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jlawren7
    wrote on last edited by
    #1

    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 Private Sub txtPassword_Change() 'test the input from the user to see if tey swiped their card correctly If Left(txtPassword, 1) = ";" And Right(txtPassword, 1) = "?" Then Dim cardID As String Dim X As Integer ' x is te user response to the message box X = MsgBox("Are you logging In ?", vbYesNo) **Question 1** If X = 6 Then Load frmCardLogIn cardID = txtPassword.Text frmCardLogIn.txtPassId.Text = cardID frmCardLogIn.LogOutBtn.Visible = False frmCardLogIn.Label2.Visible = False frmCardLogIn.Show Unload Me Else 'If X = 7 Then Dim Y As Integer ' y is the answer to the message question Y = M

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups