Results 1 to 6 of 6
  1. #1
    InThrees is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    4

    Form ListBox Know-how

    My roommate wants me to set up an Access db to track tenant rent payments, since we're all out of work deadbeats who can only really pay piece-meal, or in barter.



    He wants a db that will let him enter a payment, indicate whether it is cash or not, and if not, enter some notes to see what sort of arrangement was made. (I.E., $100 'payment' actually consisted of deadbeat roommate creating monthly rental db in Access.)

    So I'm looking at:

    *Tenants Table*
    Tenant ID (Primary Key) - linked to ID in transactions table
    Tenant Name
    Tenant Rent (monthly rent rate, fixed value)

    *Transactions Table*
    Transaction ID, primary key
    Tenant ID, linked to tenants table -> tenant id
    Transaction Date
    Transaction Amount
    IsCash (yes or no)
    Notes (if not cash, then what)


    What I CANNOT figure out is the entry form for entering payments. What I would like is a form (called Entry or similar) that lets him select the roommate making a payment, the amount of the payment, whether it's cash, what day it was made, and any notes.

    The problem I'm running into is allowing a selection of the roommates name to then translate into looking up the appropriate Tenant ID and then inserting that into the transactions table when the form is filled out. (If that's not clear, please say so and I'll try to be more explicit.)

    Or put another way, I'd like to populate a list box with values (all unique) from all records in one table, and then have the form insert a related field from the chosen record into another table.

    In other words, the list box shows our names, but selecting a name means our Tenant ID is entered into the transactions table.

  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,521
    Your form would be bound to the transactions table. The combo or list box would be bound to the tenant ID field in that table, but its row source would be the tenants table (or a query based on it).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    InThrees is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    4
    Ok, thanks to your help I got that part to work, but now on to the next problem - if I doubleclick the form with no records in transactions, I can fill out the form and hit enter and close the form and then see the new information in transactions (i.e., it now has a record with what I just entered.)

    However, if transactions has a record then that record populates the form when I open it up again, and subsequent alterations of the data in the form (i.e., let's add a new payment) actually overwrite the old record.

    How do I make the form instantiate empty and add a new record when done?

    I added a button, labeled it 'Done' and had it close the form when clicked, and the record was added, but then subsequent openings of the form were populated with the record, which was again updated rather than a new record being added.

    I could do all this with php and mysql, but access is a monster I'm just not familiar with. =(

    nevermind - roommate pointed out the little 'new record' star button in form view, and said that's what he was used to, so nothing elegant is needed here.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Another option is to set the form's data entry property to Yes, which will make it open to a new record all the time. You can also use the arguments available to OpenForm to open it in data entry or edit mode, as desired.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    InThrees is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    4

    Thumbs up

    Quote Originally Posted by pbaldy View Post
    Another option is to set the form's data entry property to Yes, which will make it open to a new record all the time. You can also use the arguments available to OpenForm to open it in data entry or edit mode, as desired.
    Thank you again! I will alter the data entry property. You have single-handedly made me think this site is awesome in the span of 12 hours.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    LOL! Happy to help, and welcome to the site by the way.
    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. ListBox problem.
    By Yurimeta19 in forum Access
    Replies: 5
    Last Post: 07-01-2010, 08:05 PM
  2. Sync ListBox?
    By rosh41 in forum Forms
    Replies: 4
    Last Post: 06-21-2010, 11:12 AM
  3. How do I get data from a listbox?
    By cowboy in forum Programming
    Replies: 1
    Last Post: 06-15-2010, 02:28 PM
  4. Update form when data collected from Listbox
    By Evetsllub in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:33 PM
  5. Listbox question
    By uaguy3005 in forum Access
    Replies: 1
    Last Post: 03-05-2010, 08:35 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