Msg Box help

ian_ok

Registered User.
Local time
Today, 17:08
Joined
May 1, 2001
Messages
90
How would I get the date entered into a text box to appear in my msgbox - should no results be showed, the form that this msgbox will open on is not where the date entered field is.

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No certificates expired prior to ", vbInformation, "NO RECORDS EXPIRED"
Cancel = True
Exit Sub
End If

Thanks Ian

End Sub
 
MsgBox "No certificates expired prior to "& Forms.MyForm.MyTextBox, vbInformation, "NO RECORDS EXPIRED"
 
I've added to the code but get an error any help? Is it inconnection to using an underscore - it doesn't like the space?

Ian

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No certificates expired prior to "& Forms.Householder_Menu.Text70, vbInformation, "NO RECORDS EXPIRED"
Cancel = True
Exit Sub
End If
 
Try:

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No certificates expired prior to " & Forms![Householder Menu]![Text70],vbInformation, "NO RECORDS EXPIRED"
Cancel = True
Exit Sub
End If
 
Thanks for that Ian...perfect.

When you have text in a message box, how do you get certain parts of it to start on a new line or be in the middle?

Ian
 
Dave and others......Thank you.

I ran a search after posting this and found a few things out amongst you link Dave (thank you).

Am now playing around with vbTab VbCr and @@ (fun for a newbie - No way to centre the text I gather) - Also to get more lines do you have to do vbCr & vbCr or can you code it to add as many lines as you want?

Ian


[This message has been edited by ian_ok (edited 11-13-2001).]
 
Just set a variable to the number of lines you want eg

Dim NewLines As String
NewLines = VbCrLf & VbCrLf & VbCrLf etc..

Then just use the variable in your code.

hth
 

Users who are viewing this thread

Back
Top Bottom