AndyCabbages
Registered User.
- Local time
- Today, 09:31
- Joined
- Feb 15, 2010
- Messages
- 74
Basically I have a form where you select 3 types of quipment to add to a table, but when you try and add the equipment you get the following error:
Run Time Error 3075 Missing Operator
I have looked this up and from what I can gather its a syntax error somewhere, but my coding is not great so I cant figure out where the problem is. The code where for the function with the error is:
Private Function workingDates()
Dim dbsThisDatabase As Database
Set dbsThisDatabase = CurrentDb()
Dim workingRecords As DAO.Recordset
recordNo = Forms![Hire Contracts]!Record_Number
datesSQL = "SELECT * FROM Hired where Record_number = " & recordNo & " and defaultDates = True"
Set workingRecords = dbsThisDatabase.OpenRecordset(datesSQL)
If workingRecords.RecordCount = 0 Then
Forms![Hire Contracts]!hireFrom = Null
Forms![Hire Contracts]!hireTo = Null
Forms![Hire Contracts]!noOfDays = Null
Else
Forms![Hire Contracts]!hireFrom = workingRecords!Hired_From
Forms![Hire Contracts]!hireTo = workingRecords!Hired_To
Forms![Hire Contracts]!noOfDays = workingRecords!WorkingDays
End If
End Function
The part in red is the line that the debugger points you to.
Run Time Error 3075 Missing Operator
I have looked this up and from what I can gather its a syntax error somewhere, but my coding is not great so I cant figure out where the problem is. The code where for the function with the error is:
Private Function workingDates()
Dim dbsThisDatabase As Database
Set dbsThisDatabase = CurrentDb()
Dim workingRecords As DAO.Recordset
recordNo = Forms![Hire Contracts]!Record_Number
datesSQL = "SELECT * FROM Hired where Record_number = " & recordNo & " and defaultDates = True"
Set workingRecords = dbsThisDatabase.OpenRecordset(datesSQL)
If workingRecords.RecordCount = 0 Then
Forms![Hire Contracts]!hireFrom = Null
Forms![Hire Contracts]!hireTo = Null
Forms![Hire Contracts]!noOfDays = Null
Else
Forms![Hire Contracts]!hireFrom = workingRecords!Hired_From
Forms![Hire Contracts]!hireTo = workingRecords!Hired_To
Forms![Hire Contracts]!noOfDays = workingRecords!WorkingDays
End If
End Function
The part in red is the line that the debugger points you to.