Is it possible to create a small table to handle the DocNo ?
I would handle like this, create a table such as I name it "Trpx",
My suggest is write a few code to "auto-generate" the next no
Doctype NextDocNo
Quot No
Try
Me.TrpxTableAdapter.Fill(Me.MyTradeDataSet.Trpx, "QUOT")
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
QuotNoTextBox.Text = DocTypeTextBox.Text & NextDocNoTextBox.Text
Me.Validate()
Me.QuoHeaderBindingSource.EndEdit()
Me.QuoHeaderTableAdapter.Update(Me.MyTradeDataSet.QuoHeader)
Dim NoIncrement As Integer = Integer.Parse(NextDocNoTextBox.Text)
NoIncrement = NoIncrement + 1
NextDocNoTextBox.Text = NoIncrement.ToString
Me.TrpxBindingSource.EndEdit()
Me.TrpxTableAdapter.Update(Me.MyTradeDataSet.Trpx)
The Detail table have a auto-id field by database and a foreign key refer to master, whatever, no use at all
So at the Save button update the detail , Select the current ID , after update the master and detail , add int 1 to the NextDocNo,
Is it what you need ? I hope it useful. I am a new learner in 2005, haha,
Also from HKSAR