Well, I was trying to keep this easy, but since I only know 49.3% of what I'm doing...
Say for example I have a form called "test" and it contains a field called "test_field" from a table called "test". Then say I have another table called "staff_relations" which contains several fields, one specifically called "process_owner" and the other called "director". the two tables are not related.
What I was trying to do, in a very simple way, was after "test_field" was updated with whatever, to put in code using recordset, to open up the "staff_relations" table, search for specific text in the "process_owner" field, and when it finds it (assume there is only 1 occurrence of it), to replace the value of "test_field" with the value of "director" in that same record in the "staff_relations" table. So I did:
Private Sub test_field_AfterUpdate()
Dim rst As Recordset
Dim db As Database
Set rst = db.OpenRecordset("SELECT * FROM staff_relations WHERE [Process_Owner] = Baird, Sean")
If rst.RecordCount > 0 Then
Let Form!test.test_field = rst.Fields(5).Value
End If
rst.Close
End Sub
It doesn't work...what am I missing?
Say for example I have a form called "test" and it contains a field called "test_field" from a table called "test". Then say I have another table called "staff_relations" which contains several fields, one specifically called "process_owner" and the other called "director". the two tables are not related.
What I was trying to do, in a very simple way, was after "test_field" was updated with whatever, to put in code using recordset, to open up the "staff_relations" table, search for specific text in the "process_owner" field, and when it finds it (assume there is only 1 occurrence of it), to replace the value of "test_field" with the value of "director" in that same record in the "staff_relations" table. So I did:
Private Sub test_field_AfterUpdate()
Dim rst As Recordset
Dim db As Database
Set rst = db.OpenRecordset("SELECT * FROM staff_relations WHERE [Process_Owner] = Baird, Sean")
If rst.RecordCount > 0 Then
Let Form!test.test_field = rst.Fields(5).Value
End If
rst.Close
End Sub
It doesn't work...what am I missing?