HI,
Is there any way to add a new record to a form from another pop up form.
I have a pop up form the is opened from another subform which lists all the parts from a particular supplier. When I click a button I add the partnumber to the partnumber field of the original subform.
What I want to be able to do is instruct the subform to move to a new record so I can make more selections form the pop up form.
I know I could do this using recordsets into the underlying table, but I have lots of code that runs when a new partnumber is selected and don't want to have to redo this code somewhere else.
I have tried the following code
[Forms]![frmPurchaseOrders]![subPurchaseOrdersDetails].[Form]![PartNumber] = Me.PartNumber
DoCmd.GoToRecord acDataForm, "subPurchaseOrdersDetails", acNewRec
the fiorst line works and all of the required code runs, but the second line fails with the error "the object subpurchaseordersdetails isn't open", which a plainly not true as I have just sucessfully written to it and can see the result.
Does anyone know if this is possible, and what I am missing.
Thanks
Sue
Is there any way to add a new record to a form from another pop up form.
I have a pop up form the is opened from another subform which lists all the parts from a particular supplier. When I click a button I add the partnumber to the partnumber field of the original subform.
What I want to be able to do is instruct the subform to move to a new record so I can make more selections form the pop up form.
I know I could do this using recordsets into the underlying table, but I have lots of code that runs when a new partnumber is selected and don't want to have to redo this code somewhere else.
I have tried the following code
[Forms]![frmPurchaseOrders]![subPurchaseOrdersDetails].[Form]![PartNumber] = Me.PartNumber
DoCmd.GoToRecord acDataForm, "subPurchaseOrdersDetails", acNewRec
the fiorst line works and all of the required code runs, but the second line fails with the error "the object subpurchaseordersdetails isn't open", which a plainly not true as I have just sucessfully written to it and can see the result.
Does anyone know if this is possible, and what I am missing.
Thanks
Sue