Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control and Filtering??

Status
Not open for further replies.
Mar 15, 2002
82
US
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 two thoughts:

One you just need to go to your subform, bring up your field list up, where the edit button is located. Then delete the this edit button on your subform and then drag a new edit buttond down from the field list.

Or you might need to do the above action if it doesn't work after you do the below action first.


Go into your (Design View) table design view, where your edit button data goes to. Select that column where the data comes from your edit button. At the botton hit the lookup tab. Then in dispaly contronl make sure combo box is selected. Then in row source type, make sure you select Table/Query.
Then in you row source, make sure you select the column the data from the edit button goes to.

Bound column is: 1
Column count: 2
Column head: no
Column with: default value
List rows: 1
List with: Auto
Limit to list: yes

Now go back to my first thought and complete this action again, and see what happens.

I hope this helps.

arinkydink


 
Thanks Arinkydink. I'm in a bit of a fog this week. I'm not sure if you understood what I'm trying to do or I'm not understanding what your suggestion is. Chances are it's me, but I just want to make sure.

I don't have an edit button on the form. It's a Tab Control with 2 tabs, Add and Edit. On the Edit Tab, I have a combobox and a subform. The user will select a location from the combobox which will then filter the information on the subform to show only the record for the location selected. The problem, I think, lies with the filter. This is my first shot at using a tab control so I'm not sure if what I'm trying to do can be done. It just doesn't look like it's filtering at all. Outside of that, I think I have everything else working so far.

I appreciate your help.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top