Space In MsgBox Code

dynamix

Registered User.
Local time
Today, 23:11
Joined
Feb 9, 2005
Messages
38
I'm using the following code as a confirmation validation type thing, but currently F_Name and L_Name are not spaced apart.

So it looks like: JaneMorris on the alert box when I want it Jane Morris for example..

The code:
Private Sub cmdSaveDetails_Click()

Dim mbrResponse As VbMsgBoxResult
Dim str As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
mbrResponse = MsgBox("You have chosen to add a subscription to member: " & Me.F_Name & ".", vbInformation + vbOKCancel, "Confirm Choice")

If mbrResponse = vbOK Then
'if OK was clicked
mbrResponse = MsgBox("Confirmed choice " & Me.F_Name & Me.L_Name & ".", vbInformation + vbOKCancel, "Confirm Choice")
Else
'if Cancel was clicked
MsgBox "Subscription Cancelled"
End If
End Sub

I guess its a really easy thing, but I am such a rookie. Thanks again guys!
 
It amazes me that you worked out how to add a period on i.e. & "." but you didn't work out how to do the exact same for a space i.e. & " "

Code:
Me.F_Name & " " & Me.L_Name


Also, DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 is out of date. Replace it with the following:

Code:
DoCmd.RunCommand acCmdSaveRecord
 
SJ McAbney said:
It amazes me that you worked out how to add a period on i.e. & "." but you didn't work out how to do the exact same for a space i.e. & " "

Code:
Me.F_Name & " " & Me.L_Name
It just seemed too easy to do that.. Usually the easy thing never work..

Thanks ever so much for your help yet again.. I envy your knowledge :O.
 

Users who are viewing this thread

Back
Top Bottom