从另一个表复制记录的问题。 [英] Issues on copying Records from another table.

查看:78
本文介绍了从另一个表复制记录的问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我一直在尝试设计一个"Grid Mover"。将记录从一个表复制到另一个表。  我的问题是,复制到另一个表后,表的记录ID是否相同?  考虑我的代码:


 


 私有  Sub  AddToMR_Execute()
'在这里写代码。
如果(MROptionByOffice.SelectedItem IsNot Nothing Me .MROptionByOffice.SelectedItem。 AvailableItemForMR> 0)然后
Dim mr As MRTable = MRByEmployee.AddNew()

mr.Id = MROptionByOffice.SelectedItem.Id
mr.Qty = 1
mr.Unit = MROptionByOffice.SelectedItem。 UM
mr.ItemName = MROptionByOffice.SelectedItem.ProcurementPlanDetails.ItemName
mr.Description = MROptionByOffice.SelectedItem.Description
mr.ItemPrice = MROptionByOffice.SelectedItem.UnitPrice
mr.EmployeeTable = EmployeeTables.SelectedItem()

Me .MROptionByOffice.SelectedItem.AvailableItemForMR = MROptionByOffice。 SelectedItem.AvailableItemForMR - 1

结束 如果

结束 Sub

解决方案


 


在从另一个表复制记录的一些实验之后,我发现即使您将整个记录复制到另一个表中,它们似乎也会成为两个不同的记录。


 


Ex。  表包含FirstName,LastName,MidName,Bdate,Address。 (数据:Renante,Malubag,Abon,1973年8月31日,菲律宾塔布克市)。


 


 将此记录复制到包含ID的table2并使用ID作为条件比较这两个记录时,它们实际上不匹配。  这就像两个身份完全相同的人。我需要做什么才能将记录复制到另一个表中,以便转移或复制每个属性。  我在匹配记录时使用ID作为标准,因为考虑到表格是否使用了这么多字段,使用记录的每个细节都会非常尴尬。


 


请建议我......


 


Nante




Hi

I've been trying to design a "Grid mover" to copy records from one table to another.  My question is, does the record ID of a table be the same upon copied to another table?  considering my code:

 

 Private Sub AddToMR_Execute()
  ' Write your code here.
  If (MROptionByOffice.SelectedItem IsNot Nothing) And (Me.MROptionByOffice.SelectedItem.AvailableItemForMR > 0) Then
  Dim mr As MRTable = MRByEmployee.AddNew()

  mr.Id = MROptionByOffice.SelectedItem.Id
  mr.Qty = 1
  mr.Unit = MROptionByOffice.SelectedItem.UM
  mr.ItemName = MROptionByOffice.SelectedItem.ProcurementPlanDetails.ItemName
  mr.Description = MROptionByOffice.SelectedItem.Description
  mr.ItemPrice = MROptionByOffice.SelectedItem.UnitPrice
  mr.EmployeeTable = EmployeeTables.SelectedItem()

  Me.MROptionByOffice.SelectedItem.AvailableItemForMR = MROptionByOffice.SelectedItem.AvailableItemForMR - 1

  End If

 End Sub

解决方案

Hi,

 

After some experiment on copying records from another table, I found out that even you copied the entire record to another table, it appears that they become two distinct records.

 

Ex.  a table contains FirstName, LastName, MidName, Bdate, Address. (Data: Renante, Malubag,Abon, August 31, 1973, Tabuk City Philippines).

 

 Upon copying this record to table2 including the ID and compare this two records using the ID as criteria, they don't actually match.  This is like two persons with totally the same identity. What should I do to copy record to another table so that every property would be transferred or copied.  I used ID as criteria in matching record because it would be very awkward to use every detail of the record considering if the table uses so many fields.

 

Please advice me...

 

Nante



这篇关于从另一个表复制记录的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆