locked
I dont know RRS feed

  • Question

  • I am using Visual Studio 2008 and Microsoft Office Access 2007 database,and using sql queries created on table adapters to perform insert,update and delete operations.

    These are my WindowsForms screenshots

    Frm Client : I am storing Client's Information in Client_table in database using this form.Client_No is primary key in Client_table.

    Frm ClientPolicy :

    I am storing Information about Client's Policy in ClientPolicy_table in database using this form.Policy_No is primary key in ClientPolicy_table.When I will select the client no from combobox which is getting its all items using data bound items using client_table Binding source and display members as client no.When I will select the Client No I want to get my Client name textbox filled with client name stored for that client no in FrmClient form.

    I don't know any way to do that.Need your help....

    Tuesday, January 17, 2017 10:10 AM

Answers

  • Hello,

    You did not get the correct answer the first time because there was a lack of details, never assume we know how you are interacting with data e.g. there are DataAdapters, TableAdapters, Data Context, Entity Framework.

    In regards to two tables, I always suggest first trying the SQL insides, in this case MS-Access, then place it into a Fill method as described before then run it, does it work? Yes, continue, no seek help. If the Fill method fails at this point then you will need to adapt and each situation is different. 

    I'm not a fan of TableAdapters for something like you are doing but instead would go in the direction of writing code with OleDb connection and command objects where you can still bind to controls but requires you to write code rather than the IDE do it for you. Something to consider but going this route means tossing out much of the code, not the user interface done so far.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by NANASTUDENT Tuesday, January 17, 2017 12:37 PM
    Tuesday, January 17, 2017 12:06 PM

All replies

  • Hello,

    When posting in more than one forum you should consider including what you have learned from the other post such as this one.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/c01ddad4-769a-47c6-8e63-5306bad6acf5/data-retrieval-in-window-form-application-created-in-vb-studio-2008-and-ms-access-at-backend?forum=vbgeneral#c01ddad4-769a-47c6-8e63-5306bad6acf5


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, January 17, 2017 10:31 AM
  • Okay...I will keep this in my mind for the next time...BTW you were really helpful...Thanks a ton for helping me though it didn't did much for me but it helped my friend a lot.....
    Tuesday, January 17, 2017 11:22 AM
  • But I am still where I was...
    Tuesday, January 17, 2017 11:24 AM
  • When I asked first I didn't asked correct question and got confused by your answer then after mentioning my problem again you replied to it with answer but that's not what I really want because you know I have two tables in MS Access 2007 database and I want to get data of some columns  stored in a record in client_table using Frm_client and when I am selecting client no using combobx on FrmClientPolicy form, I want client name filled in client name textbox and then I will fill other information and save record in clientpolicy_table.Really need help
    Tuesday, January 17, 2017 11:33 AM
  • Hello,

    You did not get the correct answer the first time because there was a lack of details, never assume we know how you are interacting with data e.g. there are DataAdapters, TableAdapters, Data Context, Entity Framework.

    In regards to two tables, I always suggest first trying the SQL insides, in this case MS-Access, then place it into a Fill method as described before then run it, does it work? Yes, continue, no seek help. If the Fill method fails at this point then you will need to adapt and each situation is different. 

    I'm not a fan of TableAdapters for something like you are doing but instead would go in the direction of writing code with OleDb connection and command objects where you can still bind to controls but requires you to write code rather than the IDE do it for you. Something to consider but going this route means tossing out much of the code, not the user interface done so far.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by NANASTUDENT Tuesday, January 17, 2017 12:37 PM
    Tuesday, January 17, 2017 12:06 PM
  • Thank you for your help...It really contributed in completion of my project.Without your help and support it wouldn't have been possible...
    • Edited by NANASTUDENT Tuesday, January 17, 2017 12:39 PM
    Tuesday, January 17, 2017 12:39 PM