Sorry for taking so long. Here is one solution. Bear with me.
Ok, when you open the form with code, add an OpenArgs argument that is equal to your WhereCondition (filter). (I'm assuming that you are using the WhereCondition to filter your form).
So it might look something like this:<pre>DoCmd.OpenForm FormName:="frmPortfolios", View:=acNormal, _
WhereCondition:="[PortID] = 123", OpenArgs:=123</pre>
I'm sure that you get your ID number (for the WhereCondition) from a form or something, so just use it again for the OpenArgs argument.
Ok, now display the Form's properties, and set AllowAdditions to False. This will grey out the Add New (*) navigation button.
Now add a button to the form. I suggest just using the wizard - select Record Operations under Categories:, and Add New Record under Actions:. Now go to the code and add a few lines. The result might look something like this (I named my button cmdNew):<pre><font color='#000000'><font color='#000080'>Option</font><font color='#000080'>Compare</font> Database<font color='#000080'>Option</font><font color='#000080'>Explicit</font><hr align=left width=500><font color='#000080'>Private</font><font color='#000080'>Sub</font> cmdNew_Click()<font color='#000080'>On</font><font color='#000080'>Error</font><font color='#000080'>GoTo</font> Err_cmdNew_Click
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec<font color='#008000'>' txtPortID is my text box that has</font><font color='#008000'>' PortID as it's control source.</font>
Me.txtPortID = Me.OpenArgs
Me.AllowAdditions = False
Exit_cmdNew_Click:<font color='#000080'>Exit</font><font color='#000080'>Sub</font>
Err_cmdNew_Click:
MsgBox Err.Description
Resume Exit_cmdNew_Click<font color='#000080'>End</font><font color='#000080'>Sub</font></font></pre>
Hope this helps,
Russell
This message was edited by Russell Hauf on 2003-01-03 11:18
This message was edited by Russell Hauf on 2003-01-03 11:18