LeeSmith
Registered User.
- Local time
- Today, 19:38
- Joined
- Mar 17, 2006
- Messages
- 27
Hi, Im currently trying to write code to save records to a temporary table. This is the code I have so far:
Private Sub cmdSaC_Click()
Dim strSql As String
Dim rstSaveTemp As Recordset
Set dbs = CurrentDb
MsgBox "Are You Sure you want to save and continue this form at a later date", vbYesNo, "Save?"
If vbYes Then
strSql = "SELECT * FROM [tblStartSave]"
Set rstSaveTemp = dbs.OpenRecordset(strSql)
With rstSaveTemp.AddNew
!PmName = PmName
End With
Else
End If
When I get to the part of the code i've coloured red, I get the compile error: Expected function or variable. Does anyone have a clue as to why this might be?
Private Sub cmdSaC_Click()
Dim strSql As String
Dim rstSaveTemp As Recordset
Set dbs = CurrentDb
MsgBox "Are You Sure you want to save and continue this form at a later date", vbYesNo, "Save?"
If vbYes Then
strSql = "SELECT * FROM [tblStartSave]"
Set rstSaveTemp = dbs.OpenRecordset(strSql)
With rstSaveTemp.AddNew
!PmName = PmName
End With
Else
End If
When I get to the part of the code i've coloured red, I get the compile error: Expected function or variable. Does anyone have a clue as to why this might be?