Refresh form and display new record

  • Thread starter Thread starter McLean J
  • Start date Start date
M

McLean J

*** updates from previous post ***
I have a form based on a query of two tables, the main one
being "tblOrder"
I have a button on that form that i'm using to basically
duplicate part of a record. It runs an SQL statement that
appends several fields into the "tblOrder" table.

It will almost always be a new record so I need the button
to do the following three things...
1. save the new record
2. run the SQL statement to append a new record (done)
3. move to that newly created record in the form... but
since the form is based on a query, it doesn't currently
show up unless I close and reopen the form.

Please advise...
 
You could avoid the problem if you were to AddNew to the main form's
RecordsetClone instead of executing an INSERT query statement on its table.

Otherwise, you need the primary key value of the record you wish to display,
requery the form (Me.Requery), and then FindFirst the p.k. value in the
form's RecordsetClone, and set the form's Bookmark to that record.
 

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

Back
Top