Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28

    Add picked data to new table for export


    Hello, I'm preparing some database for more people something like crm. I used filter for dealing with query in a form and subform and everyone can filter his shops and his cities. But I would like to pick some shops (some lines) from this filtered table and put it in other table as a output. Could anyone advice how to do it practically?
    If needed, I can attach my file but for now there is not much for watching.
    Thank you all.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    if by 'picking some shops' you mean say you have 20 rows and you want rows 1,5,6, and 11 (at random rather than being able to filter based on location or type or some other factor) then rather than using a subform, use a multiselect listbox (not the same as a multivalue checkbox) - in the list box properties change the multi select property on the 'other' tab to simple or extended. You will then need some vba code in the after update event to identify the rows selected and take the required action. Google/bing 'access vba multiselect' to find out more.

    there are other ways, but the principle would be the same.

  3. #3
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    if by 'picking some shops' you mean say you have 20 rows and you want rows 1,5,6, and 11 (at random rather than being able to filter based on location or type or some other factor) then rather than using a subform, use a multiselect listbox (not the same as a multivalue checkbox) - in the list box properties change the multi select property on the 'other' tab to simple or extended. You will then need some vba code in the after update event to identify the rows selected and take the required action. Google/bing 'access vba multiselect' to find out more.

    there are other ways, but the principle would be the same.
    Understand. And thank you.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    I've just uploaded an example db here which you may find useful as another way to select shops

    https://www.accessforums.net/showthr...745#post330745

  5. #5
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    I've just uploaded an example db here which you may find useful as another way to select shops

    https://www.accessforums.net/showthr...745#post330745
    Thank you. I check it

  6. #6
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    I've just uploaded an example db here which you may find useful as another way to select shops

    https://www.accessforums.net/showthr...745#post330745
    Hello so I moved on. I'm a bit proud of me BUT... I have still some problem. The biggest is adding data, adding new record. I probably missing some quite important basic fact. If I may I add here my file, could you check it or suggest some improvements generally? And let me know where is mistake with adding records?
    Attached Files Attached Files

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    The primary basic fact you are missing (for editing type forms) is the rule of one form, one table - in form Seznam Lékáren you have 3 tables which is why you can't make changes

    there is sometimes a workaround where you are only changing fields in one table (in this case Lekarny) by changing the form recordsettype to dynaset - inconsistent updates

    However if you do this with your present design otherwise unchanged and you change Jmeno from say Pavel to Alena it will change all the records, not just the one you are selecting (because you are actually changing the name in the Reprezentanti table, not the link which is ID field in the Lekarny table). If users are not going to change these two fields, then change the control properties to enabled=no and locked=true and you can leave as is.

    but the better option (or necessary if you want to be able to edit these links) is to just have the Lekarney table in the form recordsource and instead include the relevant ID fields and change the controls for Mesto and JMeno to combo boxes with bound column of the ID field and rowsource to select ID and name from the relevant table Also set column width=0 to hide the first column (i.e. the ID field).

  8. #8
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    The primary basic fact you are missing (for editing type forms) is the rule of one form, one table - in form Seznam Lékáren you have 3 tables which is why you can't make changes

    there is sometimes a workaround where you are only changing fields in one table (in this case Lekarny) by changing the form recordsettype to dynaset - inconsistent updates

    However if you do this with your present design otherwise unchanged and you change Jmeno from say Pavel to Alena it will change all the records, not just the one you are selecting (because you are actually changing the name in the Reprezentanti table, not the link which is ID field in the Lekarny table). If users are not going to change these two fields, then change the control properties to enabled=no and locked=true and you can leave as is.

    but the better option (or necessary if you want to be able to edit these links) is to just have the Lekarney table in the form recordsource and instead include the relevant ID fields and change the controls for Mesto and JMeno to combo boxes with bound column of the ID field and rowsource to select ID and name from the relevant table Also set column width=0 to hide the first column (i.e. the ID field).
    Ok. Well I understand. I replace it. I thought it would be possible and it is main idea of Access to replace some columns by IDs. I'm doing it such because I have a template of database and I do it as they do. I attach it here also. I'm following only form Contact list and Contact details. I see the same situation in table contacts, columns ID stat, ID country.
    What is difference?
    Attached Files Attached Files

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    I thought it would be possible and it is main idea of Access to replace some columns by IDs
    it is - and your table structure is correct. But data storage and data presentation are two different things - data is in tables, presentation is in forms and reports.

    per your original db as designed, the form is a way of selecting a record to edit. So as constructed it is fine. But you want to be able to edit that form, in which case it needs to be as I described - or have I missed the point?

  10. #10
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    it is - and your table structure is correct. But data storage and data presentation are two different things - data is in tables, presentation is in forms and reports.

    per your original db as designed, the form is a way of selecting a record to edit. So as constructed it is fine. But you want to be able to edit that form, in which case it needs to be as I described - or have I missed the point?
    No, you didn't. Ok, so do you suggest to replace ID numbers in Lekarny table by exact values (names etc.)?

    And is good, let there also IDs because of relation between tables Lekarny and Reprezent? And use it in other form or query?

  11. #11
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    Ok, so do you suggest to replace ID numbers in Lekarny table by exact values (names etc.)?
    no. the ID fields in the lekarney table are correct. I'm suggesting on your form, you replace the name control with a combobox control for the ID field

  12. #12
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    no. the ID fields in the lekarney table are correct. I'm suggesting on your form, you replace the name control with a combobox control for the ID field
    Ok, I understand where you're pointing. But what is it for? I need to show the name. No one can remember, what number is what name or what number is what city. I understand that if I use only id from same table it will work but practicaly it is useless. I can't add new record by numbers. Or am I missing something? How to solve this?
    1) I need to show an exact names.
    2) I need add new records somehow ...any way (same form, other form....) but by names no by numbers.
    Is it possible?

  13. #13
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    2) I need add new records somehow ...any way (same form, other form....) but by names no by numbers.
    You do this in the combo as outlined in the last paragraph of post #7

  14. #14
    Vrbic00 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    28
    Quote Originally Posted by Ajax View Post
    You do this in the combo as outlined in the last paragraph of post #7
    Aha. Ok so today I have to say I don't understand very much this paragraph. I'm not sure what do you mean by "combo boxes with bound column". Could you expand on that?

  15. #15
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    better you research yourself to find out what a combo box is and how it works

    google something like 'access combobox' to find out more. Plenty of links to explain

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export Data from Access 2003 Table to SQL Server 2012 Table.
    By Robeen in forum Import/Export Data
    Replies: 3
    Last Post: 02-26-2016, 02:07 PM
  2. Replies: 1
    Last Post: 03-09-2015, 12:03 PM
  3. Replies: 6
    Last Post: 06-04-2014, 12:00 AM
  4. trying to export table data tpo Excel
    By itm in forum Access
    Replies: 2
    Last Post: 01-30-2012, 10:44 AM
  5. Replies: 2
    Last Post: 12-20-2011, 10:09 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