Opening another form and loading data into it

R

Ryan

I currently have sort of a search engine form. It has several options that
when selected creates a query on a large set of data. Everything seems to be
in order. Everything is based on my Generate button at the end. When I click
it, it is supposed to open a form with 2 graphs on it and a list. These
graphs and lists are supposed to be updated with the queries that the other
form has created. The probly I'm having is that since I'm opening a new form
it is not loading the query and updating the graphs. If I just put the graph
on the same page as the main form it updates no problem. It seems I do not
know how to make the button open up the new form, and at the same time update
the graphs with the query I just created. Any help would be much appreciated.
 
P

Pat Hartman

If you are creating the query as an SQL string, you can pass the string in
the Form's OpenArgs argument (there may be string length limitations to be
aware of) and in the Form's Open event, you can have code that takes the
OpenArgs argument and places the string in the form's RecordSource.

If Not IsNull(Me.OpenArgs) then
Me.RecordSource = Me.OpenArgs
End If

There are other solutions that may be more appropriate depending on what you
are actually doing.
 
R

Ryan

each combo box is referenced in the SQL code of the query. I have little to
no knowledge of VBA. My query should filter the data based on the combo box's
values and then when I click the generate button, I want it to open up
another from where I am keeping my graphs and upload the query data into the
graphs. Everytime I fill in the combo box values, though, when I load the
document the graphs just load blank. I also have a button on the main form to
open up the query, but its not even updating that.
 
P

Pat Hartman

You may need to add requeries to the current event of the form's open event.

Me.graph1.Requery
Me.graph2.Requery
...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top