I have the following code that I am using to enable the user to add a new record to the tblProjectFile by specifying ProjectName. Here is my code:
Dim strMessage As String
Dim strTitle As String
Dim dbsTakeoff As Database
Dim rstProjectName As DAO.Recordset
strMessage = "Are you sure you want to add " & NewData & _
" to the list of projects?"
strTitle = "Takeoff Verification"
If Confirm(strMessage, strTitle) Then
'Open the Takeoff ProjectFile Table and add the NewData value
Set dbsTakeoff = CurrentDb
Set rstProjectName = dbsTakeoff.OpenRecordset("tblProjectFile")
rstProjectName.AddNew
rstProjectName.ProjectName = NewData
rstProjectName.Update
Response = acDataErrAdded 'Requery the list
Else
Response = acDataErrDisplay 'Display the error
End If
I get the following error:
Method or Data member not found on the ProjectName portion of
rstProjectName.ProjectName = NewData line.
ProjectName is the field name in my tblProjectFile. My database name is Dynamic Form Creation.
What am I missing?
Scott
Dim strMessage As String
Dim strTitle As String
Dim dbsTakeoff As Database
Dim rstProjectName As DAO.Recordset
strMessage = "Are you sure you want to add " & NewData & _
" to the list of projects?"
strTitle = "Takeoff Verification"
If Confirm(strMessage, strTitle) Then
'Open the Takeoff ProjectFile Table and add the NewData value
Set dbsTakeoff = CurrentDb
Set rstProjectName = dbsTakeoff.OpenRecordset("tblProjectFile")
rstProjectName.AddNew
rstProjectName.ProjectName = NewData
rstProjectName.Update
Response = acDataErrAdded 'Requery the list
Else
Response = acDataErrDisplay 'Display the error
End If
I get the following error:
Method or Data member not found on the ProjectName portion of
rstProjectName.ProjectName = NewData line.
ProjectName is the field name in my tblProjectFile. My database name is Dynamic Form Creation.
What am I missing?
Scott