ian_ok
11-09-2001, 07:51 AM
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
Fornatian
11-09-2001, 08:11 AM
MsgBox "No certificates expired prior to "& Forms.MyForm.MyTextBox, vbInformation, "NO RECORDS EXPIRED"
ian_ok
11-12-2001, 04:08 AM
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
Fornatian
11-12-2001, 08:44 AM
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
ian_ok
11-13-2001, 12:31 AM
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
Oldsoftboss
11-13-2001, 01:00 AM
See my post http://www.access-programmers.co.uk/ubb/Forum7/HTML/002376.html
Hope it helps.
Dave
ian_ok
11-13-2001, 01:31 AM
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).]
Fizzio
11-13-2001, 03:00 AM
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