Writing to the same location

  • Thread starter Thread starter Mahboob
  • Start date Start date
M

Mahboob

Hi,

I have a form containing a button. When the button is clicked, it invokes a
query. The code I have is:

Private Sub GetHistoryBtn_Click()
DoCmd.Close acQuery, "getHistoryQry"
DoCmd.OpenQuery "getHistoryQry", acViewNormal, acEdit
End Sub


Every time I click the button, the query output comes over the form and I
have to close it to continue using the form.

What I want is:

The first time I click the button, the query result can come anywhere. I
will drag the result to a location and for subsequent clicks of the button,
the query results should go to the same object / location. How do I achieve
this?

Thanks,
-- M
 
The first time I click the button, the query result can come anywhere. I
will drag the result to a location and for subsequent clicks of the button,
the query results should go to the same object / location. How do I achieve
this?

By not opening a Query datasheet *at all*. Instead, you could base a
Subform on the query, and simply requery the Subform at will.
 
Back
Top