copy data from Continuous Forms to Datasheet

S

Simon

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

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

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


If any one could help it would be very useful

Thanks

Simon
 
J

John Vinson

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]
 

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

Top