General information
Category:
The Mere Mortals .NET Framework
I have 1 mm win form project and 1 mm business project. I have 1 form with the following code:
Imports System.Data
Imports System.ComponentModel
Imports OakLeaf.MM.Main
Imports OakLeaf.MM.Main.Windows.Forms
Imports Telecommunications.TelecommunicationsBusiness
Public Class BuildingMaintenanceForm
Inherits mmBusinessForm
Private _building As New Building
Public Sub New()
Cursor = Cursors.WaitCursor
Me._building = CType(Me.RegisterPrimaryBizObj(New Building), Building)
' This call is required by the Windows Form Designer.
InitializeComponent()
Me.DefaultMode()
Me.NavControl = Me.grdBuildings
Me.grdBuildings.AutoGenerateColumns = False
Me._building.GetAllData()
Cursor = Cursors.Default
End Sub
'Enable/disable buttons
Private Sub DefaultMode()
Me.btnSave.Enabled = False
Me.btnCancel.Enabled = False
Me.btnNew.Enabled = True
End Sub
'Enable/disable buttons
Private Sub EditMode()
Me.btnSave.Enabled = True
Me.btnCancel.Enabled = True
Me.btnNew.Enabled = False
End Sub
'Enable/disable buttons
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Me.DefaultMode()
End Sub
'Enable/disable buttons
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.DefaultMode()
End Sub
'Enable/disable buttons
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
Me.EditMode()
End Sub
End Class
When I click mmNew the pointer stays on the first record so If I enter my "New" data is overwrites the current record. Isn't the framework supposed to take care of this and go to the new record? Any help with this new issue?
Thanks.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only