473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Parent Child tables and Saving Table

Hello,

I am a novice, but trying my best. I am trying to make a patient table and doctor visit table for each patient, so I can log all visits for patients coming to our office....so parent table is patient, and child table is visits.

The visit table is the FK to the parent table. I can pull up each patient and visits for each, but am unable to add a new visit for that patient if I use the details view for the new visit. Can anyone help me?

Thanks alot, Heather :)

Expand|Select|Wrap|Line Numbers
  1. Public Class Form2
  2.  
  3.     Private Sub VBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VBindingNavigatorSaveItem.Click
  4.         Me.Validate()
  5.         Me.VBindingSource.EndEdit()
  6.         Me.VTableAdapter.Update(Me.ADataSet.v)
  7.  
  8.     End Sub
  9.  
  10.     Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  11.         'TODO: This line of code loads data into the 'ADataSet.p' table. You can move, or remove it, as needed.
  12.         Me.PTableAdapter.Fill(Me.ADataSet.p)
  13.         'TODO: This line of code loads data into the 'ADataSet.v' table. You can move, or remove it, as needed.
  14.         Me.VTableAdapter.Fill(Me.ADataSet.v)
  15.  
  16.     End Sub
  17. End Class
Mar 2 '07 #1
5 1774
willakawill
1,646 1GB
Hi Heather. Looks like you are using vb.net and that vb.net is writing much of the code for you. I don't do things this way so it is difficult for me to answer your question. I would put a listbox on a patient form to hold visit info and popup a dialog to enter or edit visit info.
Mar 4 '07 #2
Hi Heather. Looks like you are using vb.net and that vb.net is writing much of the code for you. I don't do things this way so it is difficult for me to answer your question. I would put a listbox on a patient form to hold visit info and popup a dialog to enter or edit visit info.
HI w,

Thank you for helping me. I believe I can do the listbox, but unsure about dialog. Also, I have tried placing a details view of my visit table on my patient form, but am unable to save data that way. If I use the grid view for visit info, I can type in data and save it without problems, but want to have multiple drop down boxes. Can you be a little bit more specific or direct me to a resource to guide me in the "dialog"?

thanks again, h
Mar 5 '07 #3
willakawill
1,646 1GB
I can only give you a vb6 scenario. I don't use .net or vb 2005 as you probably know it. If you have add, delete and edit buttons on your main form you can open a dialog form that either has the selected visit details there or allows you to enter a new visit. Click an ok button and the information will be stored in your database. Return to the main form and refresh your listbox. Hey Presto.
Mar 5 '07 #4
I can only give you a vb6 scenario. I don't use .net or vb 2005 as you probably know it. If you have add, delete and edit buttons on your main form you can open a dialog form that either has the selected visit details there or allows you to enter a new visit. Click an ok button and the information will be stored in your database. Return to the main form and refresh your listbox. Hey Presto.
thank you,

should I start using vb 6 instead of vb5?
thanks again, h
Mar 6 '07 #5
willakawill
1,646 1GB
thank you,

should I start using vb 6 instead of vb5?
thanks again, h
You are not using vb5. You are using a version of .net, probably vb 2005.
You should use what you are familiar with. VB6 is almost 10 years old. There is a very good reason why it still sells on ebay for a high price. Those of us who detest .net (vb 2005) refuse to touch it.
Mar 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: William Gill | last post by:
I am trying to get & set the properties of a widget's parent widget. What I have works, but seems like a long way around the block. First I get the widget name using w.winfo_parent(), then i...
2
by: Caroline | last post by:
I seem to always want to do this type of join, but I can never find how to do this. I am trying to join two tables. The parent table will always have one row of data and the child may have 0 to...
0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
3
by: maricel | last post by:
Is there a way to list (using db2 command or catalogs) to list hierarchy of table parent & child relationship: 1) A list that shows which table should be deleted first,second,third... 2) A list...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
0
by: Chris Waldmann via .NET 247 | last post by:
Here's the deal. I have a Typed Dataset. For simplicity, we'll say it has 2 tables Parent and Child with a FK in Child, relationname = FK, cascade on update. Kyes are negative autoincrement. I...
3
by: reachsamdurai | last post by:
Is it possible to determine the list of child/parent tables for a particular table from any system catalog tables? Using the syscat.tables I'm able to retrieve the no of dependent parent/child...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.