Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Private Sub Calendar5_Click() Me![JD] = Me!Calendar5.Value Me![JD].Requery Me![NBD] = GetBusinessDay([JD], 1, "23456", 1, "Holidays", "Holiday Dates") Me.Refresh Dim rs As DAO.Recordset Dim sql As String sql = "SELECT * FROM Calendar INNER JOIN [Job Spec] ON Calendar.[ID] = [Job Spec].[ID] WHERE (((Calendar.[Job Date])= " & Me![JD].Value & "));" Set rs = CurrentDb.OpenRecordset("Calendar", dbOpenSnapshot) If rs.BOF And rs.EOF Then 'IT MEANS THERE ARE NO RECORDS, WE ARE AT THE BEGINNING OF FILE AND END OF FILE Else Do Until rs.EOF 'DO UNTIL END OF RECORDSET 'BELOW MIGHT NOT BE THE CONDITION YOU ARE AFTER, EXAMPLE ONLY If rs![Job Date] = [Forms]![Main]![JD] Then 'NOTE FIELD NAMES ARE REFERENCED BY ! DoCmd.RunSQL sql Else rs.AddNew rs![Job Date] = [Forms]![Main]![JD] rs![NextBusinessDay] = [Forms]![Main]![NBD] rs.Update End If rs.MoveNext 'THIS MOVES TO THE NEXT RECORD IN THE RECORDSET Loop 'CLEAN UP MEMORY AT END If Not rs Is Nothing Then rs.Close Set rs = Nothing End If End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.