End date less (earlier) than Start date

batowiise

Registered User.
Local time
Today, 10:42
Joined
Nov 9, 2010
Messages
17
Hi Everyone,

I have two unbound text fields namely txtStartDate and txtEndDate on a form. I want to verify that txtEndDate is not less (earlier) than txtStartDate and when this condition is met, a message pops up notifying the user.

I have tried using the following code but am not getting the desired result.

txtEndDate.SetFocus
If txtEndDate.Text < txtStartDate then
Msg "Please rectify Date, End Date earlier than Start Date"
txtEndDate.SetFocus
exit sub
End If

Your help and support is much needed and welcome.

Thanks in advance
 
I have answered this in your other thread.

Please read the rules about this forum.
 
I will do as much as possible to refrain from double posting.

Now am implementing similar thing. But this time the user will select the employee and i expect the email field should be populated automatically.

I have started by placing two unbound text boxes on a form. I have been able to do the listing of employees on the first text box. I however need the email appear after the employee is selected.

Regards.

Batowiise
 
On your form create a combo box using the wizard, in the steps select the table with the data in it, and then select the id field, name and email address then continue to the end.

You should then look at the properties of the combo box and take a note of the column numbers.

Then you can look at the row source further down the properties and adjust it in the query window so you only see the id field, join the user name into one field and also show the email address.

Next you adjust the columns and width so you end up seeing the user name complete.

Then in the after update event you can set it so it populates the text boxes you have with the name and email address. When refering to column in the code please note that the id field (1st one) is (0), so the Name would be (1) and Email address would be (2)

Private Sub cboName_AfterUpdate()
Me.txtName.Value = Me.cboName.Column(1)
Me.txtEmail.Value = Me.cboName.Column(2)
End Sub
 
Thanks, it did work. Can i have the report send in pdf formart?
 
Hi,
I did try outputting the report in pdf format but it was not possible.

I would like the body of email to pick the name of the employee and the salary month. This is what i am trying to implement:

Dear <EMPLOYEE NAME>

Please find attached herewith your salary advice for <SALARY MONTH>.

Can this be done?

Regards
 
Hi,

I have installed ClickYes to automate the clicking of yes for me. However, it does not stop. How do i stop it when it gets to the end of the file?

This is the code:

Function SendMyEmail()

Dim MySet As ADODB.Recordset

Set MySet = New ADODB.Recordset
MySet.Open "qryEmailAddress", CurrentProject.Connection, adOpenStatic

Do Until MySet.EOF

[Forms]![frmSendEmail].[txtEMployee].Value = MySet![Index Number]
[Forms]![frmSendEmail].[txtEmail].Value = MySet!

DoCmd.SendObject acReport, "PaySlips", "SnapshotFormat(*.snp)", [Forms]![frmSendEmail].[txtEmail], "", "", "Payslip", "Please find attached your payslip", False, ""

MySet.MoveNext
Loop[/COLOR]

End Function

Regards,

Batowiise
 

Users who are viewing this thread

Back
Top Bottom