Error on scanning barcode into database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Error on scanning barcode into database

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Error on scanning barcode into database

    [Originally posted by goodbye]

    Hi all,
    I have an Access application wich need scanning barcode into database. belowe is the code i am using:

    Dim barcode As String
    Dim bar As String
    Dim str As String

    Private Sub txtBarcode_AfterUpdate()

    * * barcode = Me.txtBarcode.Text
    * * bar = CStr(Mid(barcode, 1, 10))
    * *
    * * Call updatedatebase(bar)

    End Sub

    Private Sub updatedatebase(str As String)
    Dim dbs As Database
    Set dbs = OpenDatabase("test.mdb")

    Let str = "Insert into test (barcode) values ('" & str & "')"
    dbs.Execute str

    End Sub

    The code works fine, i tried many times. BUT I want to clear up txtBarcode after intert barcode into database. So, I add a new line code in updatedatabase function:

    txtBarcode.text = ""

    Then, I got a error! Why? Please hlpe!
    Thank you all!

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Error on scanning barcode into database

    [Originally posted by Ron Weller]

    txtBarcode.value = ""

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Error on scanning barcode into database

    [Originally posted by goodbye]

    Thanks Ron! If i add txtbarcode.setFocus code, i also get an error, why? Thanks again!

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Error on scanning barcode into database

    [Originally posted by Ron Weller]

    Read the error message again, it should tell
    you why it won't setfocus. If you can't figure
    out why it won't work try using gotocontrol

    DoCmd.GoToControl "txtbarcode"


  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    request

    [Originally posted by mohamed hasmeer]

    Dear Sir,
    * * * * I am a student, i have one project this year.But i think barcode system is doing well,because it's very useful for my,for example i select the any taxtiles shop, my barcode include price, item no, color etc. so how to connect the database(use access)in VB. please give me a idea about the matter, coding include.

    thank u
    wait for u r mail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center