Ask Experts Questions for FREE Help !
Ask
    gwallace1's Avatar
    gwallace1 Posts: 25, Reputation: 1
    New Member
     
    #1

    Dec 30, 2008, 04:17 PM
    Form / subform and record junction table
    Can you have a form with a subform and have both bound to the same table? I have a junction table for entering equipment issued to an employee. I want the header of the form to have a combobox to select the employee and I want the subform to view the equipment issued and be able to add new records. I had it working... sort of, it would open and generate a duplicate record that would force me to go into the transactions table and delete it to be able to go back and open it... Not exactly sure why, unless there was something on the way the form opened... Any Ideas on how to make this work.. I am mainly looking at the layout of the form... I like the one Employee Combobox on top and then a continuous form below made to look like a datasheet that I can add/edit.. . Tables are:

    Edit.. I don't want the Employee name to be recreated for every transaction record... Which is why I attempted the form/subform look.

    Employees
    EmployeeID (pk)

    Equipment
    EquipmentID (pk)

    Transactions
    TransactionID(pk)
    EmployeeID (fk)
    EquipmentID (fk)
    TransactioDate
    QtyIssued


    Thanks.
    gwallace1's Avatar
    gwallace1 Posts: 25, Reputation: 1
    New Member
     
    #2

    Dec 30, 2008, 04:45 PM

    Actually I just figured it out... I just used an unbound main form and used the afterUpdate property for the combobox to open the correct record in the subform. Now it works fine... Thanks anyway.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Dec 31, 2008, 09:30 AM

    That can work, but using a the correct form for a main form/subform would be better. From what you explained, you want to view the Employee in the main form and their equipement transactions in the subform. That's very common.

    You bind the main form to the employee table and display whatever info about the employee thatr you want. In the form header you can put a "search combo" to select a specific employee.

    You add a subform bound to the Transactions table and linked to the main form on EmployeeID. In the subform you set the EmployeeID control's Visible property to No so you don't see that. You have a combo to select the piece of equipment. The subform will display all transactions associated with the employee and allow you to add new ones.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Cascading list box lookup fields in the table design not on a form [ 3 Answers ]

I am trying to make a set of cascading list box lookup fields. If I were going to do it on a form it would be easier, I could VBA to do it. But I'm trying to do it in the table design, and not having much luck I would think it could be done via rowsource in the lookup section for a listbox field...

Want Button on Access Form for Inserting OLE Object into Table [ 1 Answers ]

Hi. I'm looking for a simple simple simple solution that will allow me to add a button to an Access form. When the button is clicked, a File Dialog box should appear allowing me to pick any file to insert into the OLE package. I've searched every corner of the web and have found a lot of...

Which table to create main form [ 3 Answers ]

I have created the following tables per a response from Scottgem at to another user asking about creating a Access Database for a survey. My database has 26 questions with answers range being not very true to verry true with a couple simple yes no answers. Where I am stumped is how to display...


View more questions Search