Results 1 to 4 of 4
  1. #1
    NickWren is offline Advanced Beginner
    Windows XP Access 2013
    Join Date
    Dec 2015
    Location
    Connecticut
    Posts
    70

    Angry On Event VBA Code Help

    I am programming a barcode system into our access database, the barcode comes out in a 10 character output (ex. PL-0001-NT). I have the code that can read the output find that sample and put the time stamp of when it was "scanned in".



    Code:
    Private Sub Text18_Exit()
    Me.Requery
    Me.BloodProcess.Value = True
    Me.DateBloodProcess = Date
    Me.StartTimeBloodProcess = Time
    Me.BloodProcessedIntials.Value = Text5.Value
    Me.Refresh
    DoCmd.Save
    End Sub
    This takes the barcode searches in a query (finds the sample) and puts the date and time that they were scanned. However for the text field to realize that there is something inside there I have to set it to lostfocuse or exit. I want to have the 10 character code be entered onces it reads a length of 10, then when we scan the next barcode in (without deleting the old one) erase the last one and put the next 10 character code in.

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Textboxes have a property called Enter Key Behavior. set it to New Line.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    at the event where it reads the barcode, (not sure where it happens, at BarCodeEndScan() ?)
    then next step ,run Text18_Exit
    maybe:

    Code:
    sub txtBoxCode_Change()
      if len(txtBoxCode)=10 then  Text18_Exit
    end sub

  4. #4
    NickWren is offline Advanced Beginner
    Windows XP Access 2013
    Join Date
    Dec 2015
    Location
    Connecticut
    Posts
    70
    How do I make it so that the Text18_Exit doesnt happen then? till txtboxcode equals the length of 10?

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

Similar Threads

  1. Replies: 7
    Last Post: 05-28-2013, 09:11 AM
  2. How to suppress Current event code?
    By RonL in forum Forms
    Replies: 5
    Last Post: 04-12-2013, 12:43 PM
  3. Timer Event Code Stops After First Run
    By burrina in forum Forms
    Replies: 3
    Last Post: 02-19-2013, 09:46 AM
  4. Replies: 1
    Last Post: 07-08-2011, 10:26 AM
  5. How to put code in form event.
    By rogdawg in forum Forms
    Replies: 4
    Last Post: 08-06-2010, 03:38 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