Call Procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a specific question/problem with VBA code. Currently, I have a form
that allows the user to select (using drop-down menus) what data they want to
display. After the user makes the selections, a button is clicked from the
form and another form appears displaying the data the user wants to see. The
user then edits the data and closes the 2nd form. In the background, I am
using VBA (using Public Sub) to pull the data from a master table into a
temporary table. The user then makes the changes to the data in the master
table and the form closes. The temp table is still there but without the
newly formatted data.

My question is, how do I update the temporary table once the 2nd form is
closed? All of my reporting is done once the user selects the data to
display (the temporary table). I may need to use a public function or a
module but my knowledge of this is limited.

I hope I haven't been to ambiguous in the description of my scenario. Can
anyone help me?

Thanks!
 
The simplest answer to your question is to use an update query that
joins the master table and the temporary table on their common primary
key field(s) and updates the latter from the former.

But I don't understand why you're pulling records into a temporary table
before editing them in the master table. There are probably much better
ways of proceeding.

If this is a single-use database, just include a Yes/No field called
"Selected" or something similar in the master table. Set things up so
that the user's selections are reflected in the state of the Selected
field. That way, everything is happening in the master table: much
simpler.

For a multi-user database, you could use a temporary table, but only to
store the primary key values of the selected records, using a query that
joins the temporary and master tables to control what's displayed on the
form. That way, both the values that are edited and the values that are
displayed come from the same source, the master table.
 
Back
Top