So the query "qryAppointment_email" will contain just one record? Try this
modified code (from what you posted); note that I have not "cleaned" up your
code, just added a step and then I fixed the OutputTo and Call MsgBox lines
to use the variable:
Private Sub cmdAppoint_email_Click()
Dim strMamName As String
Select Case MsgBox("Please attach to Outlook diary date and send to account
manager" _
, vbOKCancel Or vbInformation Or vbDefaultButton1, "New
Appointment email Attachment")
Case vbOK
End Select
strMamName = DLookup("mamName", "qryAppointment_email")
DoCmd.OutputTo acOutputQuery, "qryAppointment_email", acFormatXLS,
"C:\database\dataexport\Appointments\" & strMamName & "_" & UsrName & ".xls"
Call MsgBox("Your Appointment has exported to:" _
& vbCrLf & "" _
& vbCrLf & "C:\database\appointments\" & strMamName _
& vbCrLf & "" _
& vbCrLf & "Please attached to email and send to Account
Manager" _
, vbInformation, "Account Manager Appointment Export")
End Sub