I have the following code which is an adaptation of some other code I obtained. With it I am trying to check three different fields.
The error I'm getting the following error message: Syntax Error (missing operator in query expression.....
Private Sub uploading_data_to_ptf_Click()
Dim AppendDate As Date
Dim Source As String
AppendDate = Forms![Uploading Menu]![contridate]
Source = Forms![Uploading Menu]![wherefrom]
If DCount("[Period] & [System]", "tbl_transactions", "Month([Period])= " & Month(AppendDate) & " AND " & "Year([Period]) =" & Year(AppendDate) & " AND " & "([System]) =" & Source()) > 0 Then
MsgBox "Error", vbCritical
DoCmd.RunMacro "Uploading Data to program"
Grateful if someone could find the problem with it! thanks