Sharing A Solution to Saving Query Results

Reese

Registered User.
Local time
Yesterday, 23:48
Joined
Jan 13, 2013
Messages
387
Yes, I know that saving the results of queries is considered bad practice and/or unnecessary. In this particular case I feel that it is necessary--which I will explain below--and have found a solution that I wanted to share for those who may be in a situation like mine.

I have a form based on a table with a subform that is based on a query relating to the table. Various text boxes within the subform are bound to different results from the query. The main form has various text boxes that are bound to fields within the main form that match the fields from the query (Field A in the query matches Field A in the table, etc.).

I then use command buttons in the main form with on click events that run the following VBA:

Me.TextBoxA.Value = Me![Subform Name].Form!TextBoxA.Value

By including multiple text boxes in the VBA event I can quickly and easily save multiple pieces of information.


Here's why I need to save the query results: This particular query is a short cut to filling out new records in a table using a form. The table is of events that various clients book. The query pulls information from the last event that the client booked (time, location, program package, etc.) and displays it in the subform.

By using the above command any information that happens to be the same as the last event is quickly and easily copied into the new event but if anything is different it can still be entered manually.

I hope that people in similar situations as mine may be able to benefit from this technique. Or, if anyone has a different solution, I'd love to hear it. Thanks!
 

Users who are viewing this thread

Back
Top Bottom