Command Button Problem (1 Viewer)

margt_a

Registered User.
Local time
Today, 20:20
Joined
Aug 15, 2002
Messages
35
I use an append query to move certain records from one table to another. The user goes to the record on the Proposal form, enters the new Project Number (which is the Primary Key on the other table), and clicks a command button to append the record and move to the other form. The code for the button is below.

My problems are 1) how can I requery the Project Number field on the Proposal form before I run the query to avoid Validation Rule problems -and- 2) How can I force the Project form to open to the newly appended record? Will link criteria work on a new record?

Any assistance would be greatly appreciated.

Margaret


Command Button Code (Slightly modified from the Wizard)
----------------------------------
Private Sub cmdProposalAppend_Click()
On Error GoTo Err_cmdProposalAppend_Click

Dim stDocName As String
Dim stFrmName As String

stDocName = "qryProposalAppend"
DoCmd.OpenQuery stDocName, acNormal, acEdit

DoCmd.SelectObject acForm, "frmProposal"
DoCmd.Close

stFrmName = "frmProject"
DoCmd.OpenForm stFrmName, acNormal, , , acFormEdit


Exit_cmdProposalAppend_Click:
Exit Sub
 

Users who are viewing this thread

Top Bottom