Click here to Skip to main content
15,899,026 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: sourcecode download Pin
Christian Graus4-May-09 13:36
protectorChristian Graus4-May-09 13:36 
GeneralRe: sourcecode download Pin
Rajesh Anuhya4-May-09 18:39
professionalRajesh Anuhya4-May-09 18:39 
QuestionHow can I take one record from one form and the values to open another form? Pin
waner michaud4-May-09 3:27
waner michaud4-May-09 3:27 
AnswerRe: How can I take one record from one form and the values to open another form? Pin
Tom Deketelaere4-May-09 3:37
professionalTom Deketelaere4-May-09 3:37 
GeneralRe: How can I take one record from one form and the values to open another form? Pin
waner michaud4-May-09 5:42
waner michaud4-May-09 5:42 
GeneralRe: How can I take one record from one form and the values to open another form? Pin
Andy Missico4-May-09 14:54
Andy Missico4-May-09 14:54 
AnswerRe: How can I take one record from one form and the values to open another form? Pin
Tiyani Miyambo4-May-09 22:47
Tiyani Miyambo4-May-09 22:47 
GeneralRe: How can I take one record from one form and the values to open another form? Pin
waner michaud6-May-09 8:34
waner michaud6-May-09 8:34 
Hi Tiyani,

Thanks a lot. I think that I am moving along. I was able to parse the textboxes record and along the primary Id key that I need to the other form..
The other form has a table that consists of the foreign key from the parent table and other columns.
so when I click save on the child form, only the records from that are pertaining to the child table and dataset get saved to the database.
Not the record I parsed from the parent table..
How can I get all the input from the form the to get saved..

Here is my my saved function to look at to see where I go wrong:

Function Save() As Boolean
Dim saved As Boolean = False
Dim errors As Integer = 0

Me.Validate()
'Parent Tables where I get the record to load the other form
Me.RegistrationBindingSource.EndEdit()
Me.RegistrationTableAdapter.Update(Me.Commission1DataSet.Registration)

'child Table
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(Me.Case_fileDS.case_file)

Dim DeletedCaseFile As case_fileDS.case_fileDataTable = _
CType(Case_fileDS.case_file.GetChanges(Data.DataRowState.Deleted), case_fileDS.case_fileDataTable)

Dim NewCaseFile As case_fileDS.case_fileDataTable = _
CType(Case_fileDS.case_file.GetChanges(Data.DataRowState.Added), case_fileDS.case_fileDataTable)

Dim ModifiedCaseFile As case_fileDS.case_fileDataTable = _
CType(Case_fileDS.case_file.GetChanges(Data.DataRowState.Modified), case_fileDS.case_fileDataTable)

If Me.Case_fileDS.HasChanges Then

Try
If DeletedCaseFile IsNot Nothing Then
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(DeletedCaseFile)
End If

'Parent Tables
Me.RegistrationBindingSource.EndEdit()
Me.RegistrationTableAdapter.Update(Me.Commission1DataSet.Registration)


'child Table
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(Me.Case_fileDS.case_file)


If NewCaseFile IsNot Nothing Then
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(NewCaseFile)
End If

If ModifiedCaseFile IsNot Nothing Then
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(ModifiedCaseFile)
End If

Me.Case_fileDS.AcceptChanges()

'Parent Tables

Me.RegistrationBindingSource.EndEdit()
Me.RegistrationTableAdapter.Update(Me.Commission1DataSet.Registration)

'child Table
Me.Case_fileBindingSource.EndEdit()
Me.Case_fileTableAdapter.Update(Me.Case_fileDS.case_file)
Catch ex As Exception
MessageBox.Show("An error occurred during the update process")
' Add code to handle error here.
Finally
If DeletedCaseFile IsNot Nothing Then
DeletedCaseFile.Dispose()
End If

If NewCaseFile IsNot Nothing Then
NewCaseFile.Dispose()
End If

If ModifiedCaseFile IsNot Nothing Then
ModifiedCaseFile.Dispose()
End If
End Try
End If

Return True

End Function
----------------------------------------

Thanks for your continuing guidance

Best Regard,

Waner
Questionhow to print in textbox value? Pin
JC.KaNNaN4-May-09 0:11
JC.KaNNaN4-May-09 0:11 
AnswerRe: how to print in textbox value? Pin
Tiyani Miyambo4-May-09 0:21
Tiyani Miyambo4-May-09 0:21 
AnswerRe: how to print in textbox value? Pin
Baran M4-May-09 1:09
Baran M4-May-09 1:09 
GeneralRe: how to print in textbox value? [modified] Pin
riced4-May-09 1:24
riced4-May-09 1:24 
AnswerRe: how to print in textbox value? Pin
Dave Kreskowiak4-May-09 4:16
mveDave Kreskowiak4-May-09 4:16 
Questionhiding windows taskbar Pin
hrishiS3-May-09 23:42
hrishiS3-May-09 23:42 
AnswerRe: hiding windows taskbar Pin
Christian Graus3-May-09 23:52
protectorChristian Graus3-May-09 23:52 
GeneralRe: hiding windows taskbar Pin
hrishiS4-May-09 0:00
hrishiS4-May-09 0:00 
GeneralRe: hiding windows taskbar Pin
Samir Ibrahim4-May-09 0:14
Samir Ibrahim4-May-09 0:14 
GeneralRe: hiding windows taskbar Pin
hrishiS4-May-09 0:20
hrishiS4-May-09 0:20 
GeneralRe: hiding windows taskbar Pin
Samir Ibrahim4-May-09 0:29
Samir Ibrahim4-May-09 0:29 
GeneralRe: hiding windows taskbar Pin
hrishiS4-May-09 1:04
hrishiS4-May-09 1:04 
GeneralRe: hiding windows taskbar Pin
Samir Ibrahim4-May-09 1:30
Samir Ibrahim4-May-09 1:30 
GeneralRe: hiding windows taskbar Pin
hrishiS4-May-09 19:35
hrishiS4-May-09 19:35 
GeneralRe: hiding windows taskbar Pin
Dave Kreskowiak4-May-09 4:12
mveDave Kreskowiak4-May-09 4:12 
GeneralRe: hiding windows taskbar Pin
Mycroft Holmes4-May-09 0:14
professionalMycroft Holmes4-May-09 0:14 
GeneralRe: hiding windows taskbar Pin
Tom Deketelaere4-May-09 0:15
professionalTom Deketelaere4-May-09 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.