C
Can
What I want to be able to is edit a record using an ADODB recordset, for
example I want to change the department of the achievement. I want to be
able to edit that achievement record using the rs.open method instead of
linked tables. I got it working when referring to a single table.
My question is can I get it working when referring to more than one table?
I still only want to edit that one table, I just want to view details in
other tables. For example I want to see some department details for the
department the achievement is in. When I have tried doing it, I get "The
Recordset is not updateable".
I am using Access 2000 still. I have read the knowledgebase article ID
227053 and have added the line Me.UniqueTable = "table name"
Candace
**** Here is the code that works
Private Sub Form_Load()
'===========================
' Section 1
'===========================
' Open a connection to the database on the server
Call OpenConnection("Database Name", "IP Address")
'initialize browse controls
BrowseAchievement = Me.BrowseAchievement.ItemData(1)
Call DisplayAchievement(tmpAchieveID:=BrowseAchievement)
End Sub
Private Sub DisplayAchievement(tmpAchieveID As Long)
Dim strSQL As String
'===========================
' Section 1
'===========================
' Create and initialize an ADODB recordset
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
strSQL = "SELECT AchievementID, DeptCode, TechID, AchievementType,
CostSavings, Achievements.SavingsType, AchievementDate, AchievementComments,
AchievementDateModified, AchievementTechIDModified FROM Achievements WHERE
AchievementID = " & tmpAchieveID
'===========================
' Section 2
'===========================
'Open an ADO static recordset using optimistic locking
rs.Open strSQL, gcn, adOpenStatic, adLockOptimistic, adCmdText
Set Forms("Achievements").Recordset = rs
' Necessary for editing data in a form - Article ID 227053
Me.UniqueTable = "Achievements"
Set rs = Nothing
End Sub
example I want to change the department of the achievement. I want to be
able to edit that achievement record using the rs.open method instead of
linked tables. I got it working when referring to a single table.
My question is can I get it working when referring to more than one table?
I still only want to edit that one table, I just want to view details in
other tables. For example I want to see some department details for the
department the achievement is in. When I have tried doing it, I get "The
Recordset is not updateable".
I am using Access 2000 still. I have read the knowledgebase article ID
227053 and have added the line Me.UniqueTable = "table name"
Candace
**** Here is the code that works
Private Sub Form_Load()
'===========================
' Section 1
'===========================
' Open a connection to the database on the server
Call OpenConnection("Database Name", "IP Address")
'initialize browse controls
BrowseAchievement = Me.BrowseAchievement.ItemData(1)
Call DisplayAchievement(tmpAchieveID:=BrowseAchievement)
End Sub
Private Sub DisplayAchievement(tmpAchieveID As Long)
Dim strSQL As String
'===========================
' Section 1
'===========================
' Create and initialize an ADODB recordset
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
strSQL = "SELECT AchievementID, DeptCode, TechID, AchievementType,
CostSavings, Achievements.SavingsType, AchievementDate, AchievementComments,
AchievementDateModified, AchievementTechIDModified FROM Achievements WHERE
AchievementID = " & tmpAchieveID
'===========================
' Section 2
'===========================
'Open an ADO static recordset using optimistic locking
rs.Open strSQL, gcn, adOpenStatic, adLockOptimistic, adCmdText
Set Forms("Achievements").Recordset = rs
' Necessary for editing data in a form - Article ID 227053
Me.UniqueTable = "Achievements"
Set rs = Nothing
End Sub