Results 1 to 5 of 5
  1. #1
    zy0n1c is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Location
    AL
    Posts
    21

    Is it possible to "move" an item from one listbox to another?

    I have a rather silly project that I'm hoping I can make work in Access. Basically, as visitors enter the building our receptionist records their name, date/time, and who they're here to see. I've got that working flawlessly and it displays nicely in a List Box.

    I'd then like to put several "blank"(temporarily) list boxes to the side representing each office/personnel.

    I'd like our receptionist to be able to "move" visitors from "Lobby" list box to the office they're visiting.



    Right now I've got

    "CompanyTBL" (AutoID, List of Offices/Employees)

    "VisitorTBL" (AutoID, VisitorName, HereFor, DateNTime)

    "VisitorLog" (I'm not sure what I'm doing with this yet, honestly. Maybe the log of when the visitor actually moves to that office for their meeting?)

    Two forms: One form is Visitor Logging (write down their name, who they're here for). Other form is "Lobby" where I want to be able to move those names around.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    lstbox1 is bound to table1
    lstbox2 is bound to table2
    dbl-click the item in lst1 ,it runs an append query to add it to tbl2
    refresh the listbox after
    Code:
    sub lstBox1_dbl_click()
    docmd.setwarnings false
    docmd.openqeury "qaAdd1Itm"
    lstBox2.requery
    end sub
    query:
    insert into tbl2 ( field) select tbl1.field where tbl1.field = forms!myform!lstBox1

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    When the visitor arrives, are you more concerned with the office or the employee?
    How many offices?
    How many list boxes do you think you need/want?
    Are you concerned with when the visitor leaves Date-N-Time? Or maybe have fields ArrivalDate, ArrivalTime, DepartTime.
    Do you require visitor badges?


    Could have list boxes to see where visitors are supposed to be or could use an unbound combo box to filter a subform to select an office to see visitors.

  4. #4
    zy0n1c is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Location
    AL
    Posts
    21
    Quote Originally Posted by ranman256 View Post
    lstbox1 is bound to table1
    lstbox2 is bound to table2
    dbl-click the item in lst1 ,it runs an append query to add it to tbl2
    refresh the listbox after
    Code:
    sub lstBox1_dbl_click()
    docmd.setwarnings false
    docmd.openqeury "qaAdd1Itm"
    lstBox2.requery
    end sub
    query:
    insert into tbl2 ( field) select tbl1.field where tbl1.field = forms!myform!lstBox1
    Still trying to figure this out. Thanks for your reply.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I wouldn't bother. Not because there's anything wrong with the answer (not that I can see) but because your tables aren't really set up correctly. You can probably get this working but are liable to run into problems down the road. Since you're more concentrated on the first solution and didn't provide answers to ssanfu, I'll leave it at because whatever I say about tables might be for naught. Just sayin...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-28-2017, 12:29 PM
  2. Replies: 4
    Last Post: 09-10-2015, 08:22 AM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Add item "All" to listbox
    By Ganesh7299 in forum Access
    Replies: 4
    Last Post: 01-03-2014, 02:17 AM
  5. Replies: 3
    Last Post: 03-14-2012, 12:33 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