Hello Everybody,
I am a novice, but trying my best.
I am trying to make a visit log for specific patients that visit a doctor's office.
Patients are the parent table, and visits the child table.
Unfortunately, when I use the visit table as an FK to the patient table, I cannot add new visits when I use the details view of the visit table. It says "cannot leave patientID null". Here is the code:
Public Class Form2
Private Sub VBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VBindingNavigatorSaveItem.Click
Me.Validate()
Me.VBindingSource.EndEdit()
Me.VTableAdapter.Update(Me.ADataSet.v)
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'ADataSet.p' table. You can move, or remove it, as needed.
Me.PTableAdapter.Fill(Me.ADataSet.p)
'TODO: This line of code loads data into the 'ADataSet.v' table. You can move, or remove it, as needed.
Me.VTableAdapter.Fill(Me.ADataSet.v)
End Sub
End Class
If I don't use a FK relation, I can add visits and save them, but I must enter the patientID number for every new visit.
Is there any easy way to be able to pull up the patient, his visits, and add a new visit, without such a hassle.
Thanks alot :), Heather