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

    Text Box , please please help

    Hi all



    Can anyone please help me to solve this issue below, that will be great.


    I have MSaccess 2007.

    I have employees who scans label bar codes via ms access vba. The program end when they scan "END". every time they scan one bar code it goes to a table. Pretty straight forward. I have writen the code as well.

    Now they want to see the bar codes they scanned on the same screen as well.

    What I did is created 15 text boxes, Named them as TEXTLP1, TEXTLP2, TEXTLP3,...TEXTLP15

    I want the program to populate the bar codes each time they scanned into these text boxex TEXTLP1, TEXtLP2.

    How can I do this?

    here is my exsisting codes,

    Dim plp as string
    Do While Not plp = "END"
    plp = InputBox("ScanLP", "Scan_LP")
    If plp <> "END" And Len(plp) <> 20 Then
    MsgBox "Invalid LP scanned"
    Else
    If plp = "END" Then Exit Do


    qclp.AddNew
    qclp.Fields("PickerLP") = plp
    qclp.Fields("PickerName") = pickername
    qclp.Fields("PickerDate") = Date
    qclp.Fields("PickerTime") = Time
    qclp.Update

    <---Here I want to add a code to write the "PickerLP" (variable name plp) to the first TEXTLP1 --->
    Your help is much appreciated.
    Thanks

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    Something like this should work:

    dim i as byte, FName as string
    for i = 1 to 15
    FName = TEXTLP & i
    if isnull(me(FName)) then
    me(fname) = plp
    GoTo Exitloop
    Next

    ExitLoop:

  3. #3
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16
    Thanks JD
    I used a similar method you have provided, thanks for your help.


    b=1
    For i = 1 To 15

    For Each myctl In Me.Controls
    If TypeOf myctl Is TextBox And b = 1 Then
    If IsNull(myctl) Then
    myctl.Value = plp
    i = 15
    b = 2
    End If
    End If


    Next
    i = 15
    Next

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

Similar Threads

  1. Replies: 15
    Last Post: 04-01-2011, 11:41 AM
  2. Replies: 1
    Last Post: 11-05-2010, 04:31 PM
  3. How to vertically align text inside a text box ?
    By alexcalgary in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 08:44 AM
  4. Replies: 15
    Last Post: 09-18-2010, 01:19 PM
  5. Split text field into two text fields
    By Grant in forum Access
    Replies: 6
    Last Post: 01-31-2008, 05:52 AM

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