I'm new to VB.net coming from MS-Access and need help with this problem: I'm keeping a list of people phoning me and I'm hoping to generate a "CallNumber" with text coming from a FirstName And LastName respectively. I'm faced with a CAST DATE problems - any assistance will be greatly appreciated. Thank you.
THIS IS HOW I've DONE IT IN ACCESS.
VB.NET
THIS IS HOW I've DONE IT IN ACCESS.
Private Sub LastName_Exit(Cancel As Integer) If Me.LastName = "" Then Exit Sub Else Me.ClientNo.SetFocus Me.ClientNo = Left(Me.FirstName, 1) & Left(Me.LastName, 1) & Format(Me.ContactDate, "ddmmyyyy") Me.BusAddress.SetFocus End If End Sub
VB.NET
Private Sub dtPhoned_Leave(sender As Object, e As EventArgs) Handles dtPhoned.Leave Dim nameF As String = txtFirstName.Text Dim nameL As String = txtLastName.Text txtCallNumber.Text = Microsoft.VisualBasic.Left(nameF, 1) + Microsoft.VisualBasic.Left(nameL, 1) + dtPhoned.ToString("ddmmyyyy") End Sub
Last edited by a moderator: