Can Someone fix this code please? Highlighted in RED. Basically it just gets the values from the ComboBox.. The thing is, it "gets" the values of First And Last Name correctly only when the Name ANd Last Name are equal lenght for instance: if the name is John Elli, everything is OK. If the Last Name is long the I get like this: Entered in combox box - John Greggor. I get - John Gregg. Missing the end?
Any Ideas?
Any Ideas?
Code:
Private Sub Form_Load()
If Not IsNull(OpenArgs) Then
[COLOR="Red"]DoCmd.GoToRecord acDataForm, "Patients", acNewRec
Me.LastName = Trim(Left(OpenArgs, Len(OpenArgs) - (InStr(OpenArgs, " "))))
Me.FirstName = Trim(Right(OpenArgs, Len(OpenArgs) - (InStr(OpenArgs, " "))))[/COLOR]
End If
End Sub