Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

MS Access

  • 18-02-2013 2:55pm
    #1
    Registered Users, Registered Users 2 Posts: 127 ✭✭


    Not sure if this is the right section to be asking, but here it goes.

    Im looking to populate a table (Table2) using certain data from Table1, provided the combo box is ticked Yes.

    So basically, If the combo box is ticked, the populate Table 2 with this particular row of info, If it is not ticked, Ignore this row and do not copy it to table 2

    Thank you in advance.

    Kind Regards,

    Snow Joke


Comments

  • Registered Users, Registered Users 2 Posts: 1,456 ✭✭✭FSL


    Do you not mean a check box? As far as I am aware you select an item/items from a combo box depending on whether multi select is enabled or not. You tick/untick a check box.

    Either way you could insert into Table2 the data from Table1 associated with the object when it is ticked/selected.

    That however would not be very useful as it would be very easy to tick the wrong box. You should have another object which the user clicks on when they have checked they have selected what they intended to select and are ready to commit the action.


  • Registered Users, Registered Users 2 Posts: 1,093 ✭✭✭KAGY


    Do you really need to copy the data? This is what queries are for, and queries can be used as the basis for forms etc. Repeated data can lead to inconsistencies (i.e. you change a price of an item in table2, but the old price remain in table1 etc)

    So make a query "SelectedData" that selects whatever fields you need from table 1 where the check box is selected. The SQL for this would be
    SELECT * FROM table1 WHERE table1.selectedbox = true
    

    A little update query that updates table1 would reset all the selected codes
    UPDATE table1 SET table1.selectedbox=false where table1.selectedbox=true
    
    you can do all that in the query designer


Advertisement