Hi
I have this loop running until a count down reaches 0. It runs fine until it hits zero I think the problem is that the field doesn't exist at this time.
What I am doing is I am trying to automatting when an email goes out. It has to go through a list of adjudicators and send the report out for each one. I have it update the table when the report get sent out. It works like it is suppose to till all of them are sent out. It gives me a run time error 2427 You entered and expression that has no value. Here is the code
Code:
Do
DoCmd.SetWarnings False
DoCmd.OpenQuery "send_email_qry"
Me.Auto_name.Value = DLookup("MinOfName", "Email_Sent")
Me.adj_name.Value = Me.Auto_name.Value
Me.Adj_email.Value = DLookup("[Email]", "[Adjudicator]", "[Auto_Name] = [Adjudicator]![Name]")
DoCmd.SendObject acSendReport, "Inv_Production", acFormatPDF, [Forms]![Main_dashboard]![Adj_email], , , "Production Report for " & [adj_name], "Hi please review your production report for " & DateAdd("d", -7, Date) & " And " & Date, No
DoCmd.OpenQuery "update_sent_email"
Me.Count_foremail.Requery
DoCmd.SetWarnings True
Loop While [Forms]![Main_dashboard]![Count_foremail].[Form]![Count] > 0
MsgBox "Emails have been sent out for " & Me.team_combo, vbOKOnly, "Email Sent"
I have also added what the screen looks like.
Thanks
Andy