Hi, i have a split form on a table PROJECTS_DATA. This works fine.
However i want to add a couple of extra lookup fields in the form that populates the textboxes based on the ID field of PROJECTS_DATA table from another table.
I have included below code in Form_Load event And ofcourse this populates the additional text box of the form; only during form load.
I want the same to be triggered such that my additional lookup textboxes are populated, everytime i navigate / click on different records of the datasheet in split form
Private Sub Form_Load()
Dim strSQL As String
Dim rst As DAO.Recordset
strSQL = "SELECT Projects_Auto_Population.TITLE FROM Projects_Auto_Population WHERE Projects_Auto_Population.[MOC NUMBER] = " & "'" & Me.[MOC NUMBER].Value & "'"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
Me.MOC_TITLE.Value = rst!TITLE
rst.Close
Set rst = Nothing
End Sub
I have tried placing this on many different events of field [MOC NUMBER] , but none worked.
Please advice how can i achieve this. Thanks.