goodfela26
MIS
Hi,
I have a form with a Tab control on it that, so far, has 2 Tabs. One tab is called Add and it allows people to add information to a table. The other tab is called Edit, which of course allows them to edit, but I also want the user to be able to delete a record there. The Edit Tab has a combobox on it where the user will select a name and a subform where I want the record associated with the name to show. From there, the user can edit or delete the information. My problem is when I select a location from the combobox, the record in the subform never changes. The code activates, but I can't seem to get the filter to work. Below is the code that I have where the filter doesn't work.
Private Sub cmbAlarmLoc_AfterUpdate()
Me!txtAcct = cmbAlarmLoc.Column(1)
DoCmd.ApplyFilter , "AccountNumber = Forms!AlarmAccts!txtAcct"
Me!AlarmAcctSubform.Visible = True
Me!cmdDeleteAcct.Visible = True
End Sub
I hope I explained it clearly enough. Any help or suggestions would be appreciated.
Thanks
I have a form with a Tab control on it that, so far, has 2 Tabs. One tab is called Add and it allows people to add information to a table. The other tab is called Edit, which of course allows them to edit, but I also want the user to be able to delete a record there. The Edit Tab has a combobox on it where the user will select a name and a subform where I want the record associated with the name to show. From there, the user can edit or delete the information. My problem is when I select a location from the combobox, the record in the subform never changes. The code activates, but I can't seem to get the filter to work. Below is the code that I have where the filter doesn't work.
Private Sub cmbAlarmLoc_AfterUpdate()
Me!txtAcct = cmbAlarmLoc.Column(1)
DoCmd.ApplyFilter , "AccountNumber = Forms!AlarmAccts!txtAcct"
Me!AlarmAcctSubform.Visible = True
Me!cmdDeleteAcct.Visible = True
End Sub
I hope I explained it clearly enough. Any help or suggestions would be appreciated.
Thanks