copy record

M

microsoft

hi,

I have a list box with the values to create a new record.
based on that values I want to create a new record.
this is my code.


why the values is not copying to the new screen?
Am I doing something wrong?

Or can I directly copy the record to the new form (but that is not based on
the same table)
template table = tbltemplate (from)
call table = Call (where to insert)

Please advise
Kisoen
Private Sub crtcall_Click()
DoCmd.OpenForm "F_template", , , "tbltemplate.tempid = " &
Me.lstBooks.Column(0)


DoCmd.OpenForm "F_templateCIR", , , , acFormAdd, acWindowNormal

Forms!F_template.Tempdescription.Value =
Forms!F_TemplateCIR.ShortDescription.Value
Forms!F_template.Tempsystem.Value = Forms!F_TemplateCIR.SystemID.Value
Forms!F_template.TempSR.Value = Forms!F_TemplateCIR.Service_Request.Value
Forms!F_template.Tempserviceimp.Value =
Forms!F_TemplateCIR.serviceimpact.Value
Forms!F_template.Tempserviceurg.Value = Forms!F_TemplateCIR.ServiceUrg.Value
Forms!F_template.Tempserviceprio.Value =
Forms!F_TemplateCIR.ServicePrio.Value
Forms!F_template.Tempcategory.Value = Forms!F_TemplateCIR.category.Value
Forms!F_template.Tempsubcategory.Value =
Forms!F_TemplateCIR.subcategory.Value
Forms!F_template.Tempefforttime.Value = Forms!F_TemplateCIR.EffortTime.Value
End Sub
 
W

Wayne Morgan

You say that you have a listbox that contains the values you want to copy,
yet it appears that you are attempting to copy from multiple controls on the
form F_TemplateCIR. For example, ShortDescription, SystemID, and Request. If
these are in columns in the listbox, you need to refer to the listbox and
the column number as you have in your OpenForm call.
 
R

R.Kisoenpersad

h'mmmm
your are quite right I found this also strange.
please advise how to change the code in a way that it copy the value to the
form (f_templateCIR)

gr. kisoen
 
W

Wayne Morgan

Ok, I'm more confused now. Are you trying to copy TO f_templateCIR or copy
FROM f_templateCIR. Also, where on the form that you are copying from is the
data located. Is the data in separate textboxes or in columns of a listbox?
If in columns of a listbox, what is the name of the listbox and which column
is each piece of date in?
 

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