Navigation Control with query

musclecarlover07

Registered User.
Local time
Today, 13:22
Joined
May 4, 2012
Messages
236
Ok So I have a form for testing purposes only it is named "Navigation Form". It has a tab called WorkingInitial. Within WorkingInitial I have a form called QueryTester. With a list box called List0.

Basically I want to click on the tab and the query to automaically filter based on the criteria I create. I dont want to have to create a bunch of forms with each seperte query. I want VBA to modify the Query.

This is what i have an I have no clue why it doesnt work or what I am missing.
Code:
Private Sub WorkingInitial_Click()
 Dim strSQL As String
    List0 = strSQL
    strSQL = "SELECT * FROM [Table1 Query].[My.StatusInitial] WHERE StatusInitial = 'Working';"
 
End Sub
 
Ok So I have a form for testing purposes only it is named "Navigation Form". It has a tab called WorkingInitial. Within WorkingInitial I have a form called QueryTester. With a list box called List0.

Basically I want to click on the tab and the query to automaically filter based on the criteria I create. I dont want to have to create a bunch of forms with each seperte query. I want VBA to modify the Query.

This is what i have an I have no clue why it doesnt work or what I am missing.
Code:
Private Sub WorkingInitial_Click()
 Dim strSQL As String
    List0 = strSQL
    strSQL = "SELECT * FROM [Table1 Query].[My.StatusInitial] WHERE StatusInitial = 'Working';"
 
End Sub

Try modifying your code to:
Code:
Private Sub WorkingInitial_Click()
Dim strSQL As String
strSQL = "SELECT * FROM [Table1 Query].[My.StatusInitial] WHERE StatusInitial = 'Working';"
me.List0.RowSource = strSQL
End Sub
[/QUOTE]
 
Ok now im getting the error that it can't find List0. I have uploaded the DB. I want the same form in each tab on the left. When I click on the tab on the left it will modify the query so that the above tab is equal to the tab on the left.

ex. If I am within the Intial tab an I click Working I want it to only show me results that have the StatusInitial as Working.

Same if I did Responder and so on. I hope this is more clearer on what I need.
 

Attachments

You are telling us HOW you are doing something. It might be more useful if you told us WHAT you are trying to do. Until we understand the WHAT, we are really only guessing your needs.

There may be other options.

I always recommend you start with a description of your business issue/problem/opportunity (business facts). Then create a model of your tables and relationships.

Your attached database has 1 table, no relationships, and no real info about WHAT you are trying to do.

Anyway, bottom line is we need more info.
 
Hi,

A couple of issues based on how you have this setup up so far.
1. It seems like you're not using the navigation form to its fullest potential by taking advantage of the Navigation Where Clause property of navigation buttons in the new navigation control.
2. Your posted code is incorrect.

See attached revised database. I think this is what you want.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 

Attachments

AccessJunkie that is perfect. As for the navigation im just learning how to use that. I saw it an thought I would try it out. I had an idea and I acted on it with what I found. Im not trying to get to complicated. From here I can move to the next problem I have. Right now im jsut testing various UI for my database to see what works the best an so on.
 

Users who are viewing this thread

Back
Top Bottom