Results 1 to 2 of 2
  1. #1
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16

    How to take a user input

    Hi all

    this is what I am trying to do,

    i am writing a program, which will allow the user to scan barcodes from UPS boxes, when the user wanted to end scanning , the user scan "END", the programe will end.

    this is what i have done so far, this is creating end less loop.



    Private Sub scanUPC_Exit(Cancel As Integer)

    Dim qct As Recordset
    Dim upcs As String
    Dim LP As String

    Set qct = CurrentDb.OpenRecordset("QC:Table")

    upcs = Me.scanUPC
    LP = Me.ScanLP

    Do While Not Me.scanUPC = "END"

    qct.AddNew
    qct.Fields("UPC") = Me.scanUPC
    qct.Fields("LP") = Me.ScanLP
    qct.Update
    Me.scanUPC = ""
    If Me.scanUPC = "END" Then Exit Do
    Loop
    End Sub

    looks like , it code is not waiting for the response, its reads as space..Please help. thanks in advance.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would simply use the after update event of the textbox to handle the scans. Scanners I've used could all be configured to send a tab or carriage return after the scan, which triggers the after update event. In that code you would simply test for "END".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Reporting with user input
    By tazbergy in forum Reports
    Replies: 1
    Last Post: 09-12-2010, 11:26 PM
  2. Checking user input is valid
    By AccessPoint in forum Access
    Replies: 4
    Last Post: 07-18-2010, 06:43 PM
  3. User Input Query
    By ManC in forum Queries
    Replies: 2
    Last Post: 03-04-2010, 07:09 PM
  4. Chart with user input
    By mungyun in forum Access
    Replies: 1
    Last Post: 12-28-2009, 07:44 PM
  5. Set required user input
    By ZeusOsiris in forum Database Design
    Replies: 2
    Last Post: 12-04-2006, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums