Ravi Kumar
Registered User.
- Local time
- Today, 16:21
- Joined
- Aug 22, 2019
- Messages
- 162
hello all ,
this code is giving me runtime error 3131:"Syntax error in from clause".
can anyone please tell me how to solve this..
i am using this code show a notification if my position column is updated to 1,then 1st column "coil number" & second column is "position" both should show .
this code is giving me runtime error 3131:"Syntax error in from clause".
can anyone please tell me how to solve this..
Code:
Private Sub cmddept_Click()
Dim RS As DAO.Recordset
Dim strMsg As String
Set RS = CurrentDb.OpenRecordset("select * from (" & Me.RecordSource & ")", dbOpenSnapshot, dbReadOnly)
With RS
If Not (.BOF And .EOF) Then
.MoveFirst
While Not .EOF
If ![Position] >= 1 Then
strMsg = strMsg & ![Coil Number] & vbTab & vbTab & ![Position] & vbTab & vbCrLf
End If
.MoveNext
Wend
End If
.Close
End With
Set RS = Nothing
If strMsg <> "" Then
strMsg = "You have to Calibrate the following!!!:" & vbCrLf & vbCrLf & _
"------------------------------------------------------------" & vbCrLf & _
"Coil Number" & vbTab & vTab & "Position" & vTab & vbTab & vbCrLf & _
"------------------------------------------------------------" & vbCrLf & _
strMsg
Else
strMsg = "No record to is due for calibration"
End If
MsgBox strMsg, vbInformation + vbOKOnly
End Sub