Ok, as suggested in a previous post I managed to combine my data to one table. Now I have a problem getting my tabs to work right.
What I would like to have is a Tab form with 10 tabs. One tab per location. Im trying to get it so when a user clicks a tab for a location it filters the records accordingly.
Here is what I have done, but it isnt working right:
Private Sub Form_Load()
Me!LocationTabs = 0
Call Location_Change
End Sub
Private Sub LocationTabs_Change()
Me.RecordSource = "SELECT * FROM tblCustomerData " _
& " WHERE Location = Me!LocationTabs.Value " _
& " ORDER BY CompanyName ASC;"
End Sub
LocationTabs is the name of the tab control itself
CompanyName is a text box
tblCustomerData is where the form gets its data
Location is the name of the field that contains the location name
What is happening is when I open the form or Click a tab it pops up a box asking me what the "Me!LocationTabs.Value" is. If I type a valid location in that box and hit ok the tab does update with just those records.
I may be doing something wrong but I though it was supposed to grab the "Me!LocationTabs.Value" from the Name or Caption fields of the tab pages.
Can someone point me in the right direction for this? Thanks
What I would like to have is a Tab form with 10 tabs. One tab per location. Im trying to get it so when a user clicks a tab for a location it filters the records accordingly.
Here is what I have done, but it isnt working right:
Private Sub Form_Load()
Me!LocationTabs = 0
Call Location_Change
End Sub
Private Sub LocationTabs_Change()
Me.RecordSource = "SELECT * FROM tblCustomerData " _
& " WHERE Location = Me!LocationTabs.Value " _
& " ORDER BY CompanyName ASC;"
End Sub
LocationTabs is the name of the tab control itself
CompanyName is a text box
tblCustomerData is where the form gets its data
Location is the name of the field that contains the location name
What is happening is when I open the form or Click a tab it pops up a box asking me what the "Me!LocationTabs.Value" is. If I type a valid location in that box and hit ok the tab does update with just those records.
I may be doing something wrong but I though it was supposed to grab the "Me!LocationTabs.Value" from the Name or Caption fields of the tab pages.
Can someone point me in the right direction for this? Thanks