I am trying open a form from VBA to view a record that was moved from the original table to an Archive Table. I am having a hard time changing the record source of the form to look at the Archive table instead of the original table. If I open the form first, I am able to change the record source, but am then unable to filter to the selected record since the form is already open.
Does anyone know if I am able to change the form properties before the form is open?
Here is the code that am I currently working with:
Does anyone know if I am able to change the form properties before the form is open?
Here is the code that am I currently working with:
Code:
Public Sub RptEquipNumber_Click()
Forms!Equipment.Form.RecordSource = "Equipment Archive"
DoCmd.OpenForm "Equipment", , , "EquipNumber ='" & RptEquipNumber & "'", acFormEdit, , SrcRcd = "Equipment Archive"
End Sub
Comment