Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy record

Status
Not open for further replies.

1000kisoen

IS-IT--Management
Aug 12, 2004
37
NL
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
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

It same it removing the values from the table
or should this be reverse coding?

or how can I easyly copy the values from a lisbox to newrecord based on another table?

please advise
kisoen
 
When you code A = B that means you put the value of B into A.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
is this not correct than...
because A = the listbox (and that is F_template)
values of the listbox is stored in the form f_template

and b = F_templateCIR (the form where the values should to)

or should is be like this?
Private Sub crtcall_Click()
DoCmd.OpenForm "F_template", , , "tbltemplate.tempid = " &
Me.lstBooks.Column(0)

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

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

please advise
kisoen
 
I think you are now on the right way.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top