Results 1 to 2 of 2
  1. #1
    masoud_sedighy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    78

    How we can grab value from list box and fills automatically related text box in new f

    I have a list box and its row source is "tblitems" with bellow fields.
    Now I like when right click on this list box and select one option for example "new task" it opens new task form like attached picture and automatically Grab the item number from a list box and fills related text box "item number" in "new task" form that is bounded to table "tbltask"
    Now when I press "Apply" button it insert new record in "tbltask".
    tblItems
    item number (pk)
    item name (text)
    tbltask
    task number (auto number,pk)
    item number

    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have never seen a listbox with embedded icons. How is this constructed? That looks like a custom shortcut menu.

    With bound form, record is committed to table when close form, move to another record, or run code to save.

    Code in the listbox AfterUpdate or Click event can open form and pass the ItemNumber with OpenArgs argument.

    DoCmd.OpenForm "NewTask", , , , , Me.ItemNumber

    Code in the form Load or Open event can populate textbox, something like:

    If IsNull(Me.ItemNum) Then Me.ItemNum = Me.OpenArgs
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 01-31-2024, 09:57 AM
  2. Replies: 5
    Last Post: 12-19-2012, 07:26 PM
  3. How to store ID on list box but show related data
    By Clarionchanger in forum Access
    Replies: 3
    Last Post: 10-11-2012, 03:31 PM
  4. Replies: 2
    Last Post: 05-11-2011, 02:58 PM
  5. Replies: 11
    Last Post: 01-06-2010, 03:27 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