On 26 Dec 2006 14:45:28 -0800, "Simon" <(E-Mail Removed)> wrote:
>I have a form with two subforms frmRMAParts (Datasheet) and
>frmOrderProductsRMA (Continuous form)
>
>
>in frmOrderProductsRMA It displays products,I then have a button next
>to each recored i i would like to click andit will copy the data in
>that line into frmRMAParts
Data IS NOT STORED IN FORMS.
Data is stored in Tables, and only in Tables. Forms *are just
windows*, tools to view and edit data stored in tables.
>I have the following code for the button on frmOrderProductsRMA
>
>Private Sub Command68_Click()
>
>Forms![frmRMA]![frmRMAParts].Form![IDNumber] = Me.IDNumber
>
>End Sub
>
>
>This codes does work but it will only copy the data into frmRMAParts
>(Datasheet) if on the datasheet it is on a new recored, If its not it
>will just write over the data
Of course. That's precisely what you are asking it to do: push data
into whatever record is currently open on frmRMAParts (whether that is
the new record or an existing record.
>What i would like to do is that every time i click the button on
>frmOrderProductsRMA
>it copys the data to a new line on frmRMAParts
What you apparently are trying to do is to *insert new records into
the Table* upon which frmRMAparts is based. The simplest way to do so
is to execute an Append query.
If you are copying multiple fields (not just the IDNumber) then your
table design needs work.
John W. Vinson[MVP]
|