I am trying to run 2 append queries and concatenate two of the fields, (Last Name and First Name to create Full Name). The code runs fine except the space after the comma between the last name and first name does not show up even though it is in the code. Very confused since the comma shows up but not the space.
Here is the code:
Private Sub Form_Open(Cancel As Integer)
Dim strappendClient As String, strappendRealtor As String
strappendClient = "INSERT INTO tblGeneralList ( First_Name, Last_Name, Type, Full_Name )" & _
" SELECT tbl_Borrower_Personal_Information.Borrower_First_Name, tbl_Borrower_Personal_Information.Borrower_Last_Name," & _
" 'Client' AS Expr1, [Borrower_Last_Name] & ', '" & _
" & [Borrower_First_Name] AS Full_Name" & _
" FROM tbl_Borrower_Personal_Information"
strappendRealtor = "INSERT INTO tblGeneralList ( First_Name, Last_Name, Type, Full_Name )" & _
" SELECT ref_Realtor.Realtor_First_Name, ref_Realtor.Realtor_Last_Name," & _
" 'Realtor' AS Expr1, [Realtor_Last_Name]& ', '" & _
" & [Realtor_First_Name] AS Full_Name FROM ref_Realtor"
'Turn off Warnings
DoCmd.SetWarnings False
DoCmd.RunSQL strappendClient
DoCmd.RunSQL strappendRealtor
'Turn on Warnings
DoCmd.SetWarnings True
End Sub
thanks.
DMo
Here is the code:
Private Sub Form_Open(Cancel As Integer)
Dim strappendClient As String, strappendRealtor As String
strappendClient = "INSERT INTO tblGeneralList ( First_Name, Last_Name, Type, Full_Name )" & _
" SELECT tbl_Borrower_Personal_Information.Borrower_First_Name, tbl_Borrower_Personal_Information.Borrower_Last_Name," & _
" 'Client' AS Expr1, [Borrower_Last_Name] & ', '" & _
" & [Borrower_First_Name] AS Full_Name" & _
" FROM tbl_Borrower_Personal_Information"
strappendRealtor = "INSERT INTO tblGeneralList ( First_Name, Last_Name, Type, Full_Name )" & _
" SELECT ref_Realtor.Realtor_First_Name, ref_Realtor.Realtor_Last_Name," & _
" 'Realtor' AS Expr1, [Realtor_Last_Name]& ', '" & _
" & [Realtor_First_Name] AS Full_Name FROM ref_Realtor"
'Turn off Warnings
DoCmd.SetWarnings False
DoCmd.RunSQL strappendClient
DoCmd.RunSQL strappendRealtor
'Turn on Warnings
DoCmd.SetWarnings True
End Sub
thanks.
DMo