Volkswagen Passat Forum banner

1 - 11 of 11 Posts

·
Registered
Joined
·
3,105 Posts
Discussion Starter #1
I have a question on how to do something in MS Access.

I have a query that pull info from two tables.

Lets say the tables have the following fields:

SystemsTable:
SystemName
SystemOwner

FailureLog:
FailureID
SystemName
FailureDate

This is a one-to-many relationship between SystemsTable and FailureLog with the SystemName.

Basically I want to create a form where I can choose the SystemName in a combo box and it will make this the query parameter criteria and only show me the Failures that are of a particular SystemName. The problem is not writing the query. That is easy. However, how do I create a form that will allow me to choose the parameter criteria with a combo box? I then need to show the results of this choice in a datasheet within a form.

Any help would be appreciated.

(*NOTE: I've paraphrased my actual tables, field names, etc... just for the example)
 

·
wishin
Joined
·
3,664 Posts
I haven't done MS Office VBA stuff in years (thank god)....so I can't really help other than to say search for "VBA" or "Visual Basic for Applications" either in Access Help, msdn.microsoft.com or google.
 

·
Registered
Joined
·
2,681 Posts
So do you have a spreadsheet display in a form? I assume you want to have a combo box at the top of the form, make a choice, then have the spreadsheet display all the records that apply to that choice?
 

·
Registered
Joined
·
3,105 Posts
Discussion Starter #5
ChkYaHead said:
So do you have a spreadsheet display in a form? I assume you want to have a combo box at the top of the form, make a choice, then have the spreadsheet display all the records that apply to that choice?
Exactly.
 

·
Registered
Joined
·
3,105 Posts
Discussion Starter #7
True.... it is amazing how many forums there are out there.

Thanks for the tip Rian.
 

·
Registered
Joined
·
2,681 Posts
Well...what about this. Create a form with a combo box and a button. after selecting your choice in the combo box click the button to execute. the button's "on click" even procedure will run a query that you've previously created. that query looks to the combo box's data that you just selected in the form ([Forms]![frmTest]![cmbOption]) and opens the query based on that choice.
 

·
I got this user title because I'm old and special
Joined
·
8,552 Posts
ChkYaHead said:
Well...what about this. Create a form with a combo box and a button. after selecting your choice in the combo box click the button to execute. the button's "on click" even procedure will run a query that you've previously created. that query looks to the combo box's data that you just selected in the form ([Forms]![frmTest]![cmbOption]) and opens the query based on that choice.
Exactly....This is how you do it as stated above. Have the Criteria of the Query look at the Combo Box of the form and when you push the button on the form runs the query.
 

·
Registered
Joined
·
3,105 Posts
Discussion Starter #11
I tracked down a way to have Access link the two tables automatically based on an Unbinded field.

Basically you create a subform with a datasheet view of the query you want.

Then you create a form based on the table you want to select your query criteria from.

Then you delete all the fields and create an unbinded combo box that uses a lookup of choices of the criteria you want you query to be formed.

Then insert the subform into the main form. Access then prompts you to link them properly.

Basically, I'm sure this is doing something similar to what you guys have suggested above except that it is doing it without a button with "on click"


So now I'm stuck trying how to automatically populate a field based on the boolean combinations of 3 other fields using VBA. Considering how little I know about programming this is a struggle for me.
 
1 - 11 of 11 Posts
About this Discussion
10 Replies
5 Participants
HalfGreek
Volkswagen Passat Forum
Passatworld is a forum dedicated to Volkswagen Passat enthusiasts to discuss mods, Quattro, Turbo Diesel, reviews and more!
Full Forum Listing
Top