I'm trying to create an If Then Statement using criteria based on a calculated Month field. My code currently looks like:
If [tbl_ImportedMonths].[ImportMonth] = Month([tbl_Time].[Time.Date]) Then
MsgBox "The month you have chosen already exists. Continue?", vbYesNo, MonthAlreadyImported
End If
If MsgBox("The month you have chosen already exists. Continue?", vbYesNo, MonthAlreadyImported) = vbNo Then
GoTo exit_Sub
End If
I cannot for the life of me get the syntax right. Anything anyone can do to help would be much appreciated!
If [tbl_ImportedMonths].[ImportMonth] = Month([tbl_Time].[Time.Date]) Then
MsgBox "The month you have chosen already exists. Continue?", vbYesNo, MonthAlreadyImported
End If
If MsgBox("The month you have chosen already exists. Continue?", vbYesNo, MonthAlreadyImported) = vbNo Then
GoTo exit_Sub
End If
I cannot for the life of me get the syntax right. Anything anyone can do to help would be much appreciated!