Hi at all
I'm new on wrox p2p forum
I read the chapter 5 of this book and in particular the section regarding "building an unbound form"
I'm interested to create a button "add new record" on a extisting bounded form and use it instead of standard buttons, without writing "populateControlsonform" routine, because in my form I've got a submask and a lot of "Combo" controls.
I'm tried to use the "addnew" method, but without success: the record is created, but I'm not able to modify it: when I enter in the first field, I can add chars but I can't exit from the filed and pass to next field
Private Sub Form_Load()
Dim cnCh5 As ADODB.Connection
Dim strConnection As String
strConnection = "Provider=Microsoft.jet.OLEDB.4.0;" & _
"Data source=" & CurrentProject.Path & "\Chap_05_mio_esercizio.mdb;"
Set cnCh5 = New ADODB.Connection
Set rsContacts = New ADODB.Recordset
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open "select * from tblContacts", cnCh5
If rsContacts.BOF And rsContacts.EOF Then
MsgBox "There are no records in the db"
Set Me.Recordset = rsContacts
Me.txtLastName.ControlSource = "txtLastName"
Me.txtFirstName.ControlSource = "txtFirstName"
Me.txtMiddleName.ControlSource = "txtMiddleName"
'Me.txtContactId.ControlSource = "intContactId"
Private Sub cmdMoveNext_Click()
If Not rsContacts.EOF Then
Private Sub cmdAddNew_Click()