Hello, i am new with access vba, and i have a certain question about a specific code.
I want to create a list of buttons on a form (or one button),that each one represent a pollutant of the atmosfere.This is the easy part.Now i want to create a code, that by clicking on one of these pollutants (aka on one of these buttons)access creates a box on the same form which shows the results that correspond to each pollutant.
The results are querries for each pollutant, and by clicking on NO2 for example it will show the results from the NO2 querry on a box .
Here is the coding i have done so far, which basically is only the action when clicking on the pollutants button that opens the querry.
Private Sub button17_GotFocus()
DoCmd.OpenQuery "Metrics CO"
End Sub
Private Sub button18_GotFocus()
DoCmd.OpenQuery "Metrics NO2"
End Sub
Private Sub button19_GotFocus()
DoCmd.OpenQuery "Metrics NOX"
End Sub
Private Sub button20_GotFocus()
DoCmd.OpenQuery "Metrics O3"
End Sub
I dont want access to open the querries but display instead a box with the results from the querries.