Results 1 to 9 of 9
  1. #1
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63

    Send a back tab action

    I have an inventory DB that scans product bar codes and enters the barcode number in a [Products] field and then sets a default value of 1 for each record in the [quantity] field
    It then it goes to the next record for the next scan.
    When all scanning is completed I run a report that provides a total number of times each bar code has been scanned buy totaling the quantity field of each of the same [products] scan record.



    My issue is that when I have a quantity of like 50 then i have to scan 50 of the same item. I would like to create a button where after scanning an item i could click on a button and it would back tab to the previous record [quantity] field, which is the last field in (table view) and enter a value of 50 and then tab back to the new record for the next scan.
    A send key of {backtab},50,{tab} would do the trick but i cant find it in Access 2016. Any suggestions?

  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,518
    How about:

    Me.Quantity.SetFocus

    perhaps with GoToRecord first if appropriate m
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    Thanks Pbaldy, This is close.
    2 things
    1)I didn't mention that i need the control to be on the main form and the
    quantity field is in a sub-form named Scan Data. So i need to know how to set focus to the Quantity field in the subform named Scan Data

    2) The code below gets focus to the field as long as the button is in the sub-form, (which I'm asking how to change in point 1) but I also need it to send a
    pre determined number to that field. so i need to know how to send a number to that field

    In other words when I click on the button on the master form, it needs to go to the [quantity] field of the last record in the Subform named [Scan Data] and
    change the Quantity to 50.

    So my master form is called Customer on the master form i have 3 buttons to correct in valid data. lets say the buttons are 10, 20 30.
    When i scan data each record is posted to a sub form Named Scan Data. each record automatically gets a value of 1 in the Scan Data sub form.
    If I want the value to be 10 of the last scan then i would scan the item and the press the button 10 to change the value from 1 to 10 of the last item scanned.

    The code that works if placed in the sub form on each record is below
    The problem is that the subform is a table view so each record has to have buttons
    Private Sub Command11_Click()
    DoCmd.GoToRecord , , acPrevious
    Me.Scan Data Quantity.SetFocus
    Me.Quantity.Value = 50
    End Sub

    Thanks for your help


    perhaps with GoToRecord first if appropriate m

  4. #4
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63

    screen shot

    I just learned you can do screen shots. : ) This is what I hope to have when complete
    Attached Thumbnails Attached Thumbnails SCREEN SHOT.PNG  

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Try setting focus to the subform first:

    Me.SubformControlName.SetFocus
    DoCmd.GoToRecord , , acPrevious
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    When use Me.SubformControlName.SetFocus
    as in:

    Private Sub Command11_Click()
    Me.SubformControlName.SetFocus
    DoCmd.GoToRecord , , acPrevious
    Me.Quantity.SetFocus
    Me.Quantity.Value = 299
    End Sub

    The Result is:
    compiler error: Method or Data Member not found.

    Any Thoughts

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Um, you need to put the name of your subform control there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    Ugh, its always the simple things isn't it.... The issues is resolved. Thanks for your help

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem.
    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. can i send values back from a popup form ?
    By Ahamedos in forum Access
    Replies: 6
    Last Post: 11-20-2017, 04:40 PM
  2. where is "send to back"
    By mdavid in forum Forms
    Replies: 2
    Last Post: 10-10-2017, 12:43 PM
  3. Send to back on subform
    By lumpa1000 in forum Forms
    Replies: 2
    Last Post: 02-27-2017, 11:59 PM
  4. VBA for Embedded Image in Form 'Send To Back'
    By Kirsti in forum Programming
    Replies: 6
    Last Post: 06-11-2014, 09:21 PM
  5. Replies: 4
    Last Post: 05-21-2012, 08:21 AM

Tags for this Thread

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