请问一下 , 为什么已经新增 ,却终是修改 第二个 记录 ,完全没有记录时 又能新增保存 。
新增部分 :
Dim txt_primary_key As WinForm.TextBox = e.Form.Controls("txt_primary_key")
Dim txt_inv_number As WinForm.TextBox = e.Form.Controls("txt_inv_number")
Dim txt_customer_cname As WinForm.TextBox = e.Form.Controls("txt_customer_cname")
Dim txt_customer_fax As WinForm.TextBox = e.Form.Controls("txt_customer_fax")
Dim txt_customer_no As WinForm.TextBox = e.Form.Controls("txt_customer_no")
Dim txt_customer_tel As WinForm.TextBox = e.Form.Controls("txt_customer_tel")
Dim txt_hdd_info As WinForm.TextBox = e.Form.Controls("txt_hdd_info")
Dim txt_item_desc As WinForm.TextBox = e.Form.Controls("txt_item_desc")
Dim txt_lan_ip As WinForm.TextBox = e.Form.Controls("txt_lan_ip")
Dim txt_monitor As WinForm.TextBox = e.Form.Controls("txt_monitor")
Dim txt_motherboard As WinForm.TextBox = e.Form.Controls("txt_motherboard")
Dim txt_pc_cpu As WinForm.TextBox = e.Form.Controls("txt_pc_cpu")
Dim txt_pc_remark As WinForm.TextBox = e.Form.Controls("txt_pc_remark")
Dim txt_photo_path1 As WinForm.TextBox = e.Form.Controls("txt_photo_path1")
Dim txt_photo_path2 As WinForm.TextBox = e.Form.Controls("txt_photo_path2")
Dim txt_photo_path3 As WinForm.TextBox = e.Form.Controls("txt_photo_path3")
Dim txt_photo_path4 As WinForm.TextBox = e.Form.Controls("txt_photo_path4")
Dim txt_photo_path5 As WinForm.TextBox = e.Form.Controls("txt_photo_path5")
Dim txt_wifi_ip As WinForm.TextBox = e.Form.Controls("txt_wifi_ip")
Dim str_pc_serial As String
Dim lbl_status As WinForm.Label = e.Form.Controls("lbl_status")
p_primary_key = DataTables("pc_master") .Compute("Max(primary_key)") + 1
P_Row_pc_master=Tables("pc_master").AddNew()
P_Row_pc_master("primary_key")=P_primary_key
P_Row_pc_master("invoice_number")=P_primary_key
txt_inv_number.Text=P_primary_key
txt_primary_key.Text=P_primary_key
保存部分:
Dim txt_primary_key As WinForm.TextBox = e.Form.Controls("txt_primary_key")
Dim txt_inv_number As WinForm.TextBox = e.Form.Controls("txt_inv_number")
Dim txt_customer_cname As WinForm.TextBox = e.Form.Controls("txt_customer_cname")
Dim txt_customer_fax As WinForm.TextBox = e.Form.Controls("txt_customer_fax")
Dim txt_customer_no As WinForm.TextBox = e.Form.Controls("txt_customer_no")
Dim txt_customer_tel As WinForm.TextBox = e.Form.Controls("txt_customer_tel")
Dim txt_hdd_info As WinForm.TextBox = e.Form.Controls("txt_hdd_info")
Dim txt_item_desc As WinForm.TextBox = e.Form.Controls("txt_item_desc")
Dim txt_lan_ip As WinForm.TextBox = e.Form.Controls("txt_lan_ip")
Dim txt_monitor As WinForm.TextBox = e.Form.Controls("txt_monitor")
Dim txt_motherboard As WinForm.TextBox = e.Form.Controls("txt_motherboard")
Dim txt_pc_cpu As WinForm.TextBox = e.Form.Controls("txt_pc_cpu")
Dim txt_pc_remark As WinForm.TextBox = e.Form.Controls("txt_pc_remark")
Dim txt_photo_path1 As WinForm.TextBox = e.Form.Controls("txt_photo_path1")
Dim txt_photo_path2 As WinForm.TextBox = e.Form.Controls("txt_photo_path2")
Dim txt_photo_path3 As WinForm.TextBox = e.Form.Controls("txt_photo_path3")
Dim txt_photo_path4 As WinForm.TextBox = e.Form.Controls("txt_photo_path4")
Dim txt_photo_path5 As WinForm.TextBox = e.Form.Controls("txt_photo_path5")
Dim txt_wifi_ip As WinForm.TextBox = e.Form.Controls("txt_wifi_ip")
Dim str_pc_serial As String
'p_primary_key = DataTables("pc_master") .Compute("Max(primary_key)") + 1
P_selected_formname="PC_Master"
messagebox.Show(" p_primary_key " & p_primary_key)
Functions.execute("Sub_GetSerial")
messagebox.Show (p_serial)
str_pc_serial=P_Serial
P_Row_pc_master("primary_key")=P_primary_key
P_Row_pc_master("pc_cpu")=txt_pc_cpu.text
P_Row_pc_master("customer_cname")=txt_customer_cname.text
P_Row_pc_master("customer_fax")=txt_customer_fax.Text
P_Row_pc_master("customer_tel")=txt_customer_tel.Text
P_Row_pc_master("pc_hdd_info")=txt_hdd_info.Text
p_Row_pc_master("pc_serial")=str_pc_serial
P_Row_pc_master.Save
此主题相关图片如下:sp20200602_140826.png