我用同一个表单FORM1作插入或更新界面,另有一个FORM2作查询界面,当查询选中记录时,就将这条记录的标识赋值给FORM1.hint,举例来说:一个FORM1中有EDIT1,EDIT2两个输入框,BUTTON1 为“保存”,当FORM1的TAG为
0时插入;当FORM1的TAG为1时更新。SQLServer数据库结构为:标识(自动增长),字段1,字段2
  SQLStr :String;if Form1.Tag=0 then
begin
  SQLStr :='Insert Into 表名(字段1,字段2) VAlues (:a,:b)'  ;
  CustomDM.PubQuery.Close;
  CustomDM.PubQuery.SQL.Clear;
  CustomDM.PubQuery.SQL.Add(SQLStr);
  CustomDM.PubQuery.Parameters.ParamValues['a'] :=Trim(Edit1.Text);
  CustomDM.PubQuery.Parameters.ParamValues['b'] :=Trim(Edit2.Text);
  CustomDM.PubQuery.ExecSQL;
end
else if Form1.Tag=1 then
begin
  SQLStr :=Update 表名 set 字段1=:a,字段2=:b where 标识=:c  ;
  CustomDM.PubQuery.Close;
  CustomDM.PubQuery.SQL.Clear;
  CustomDM.PubQuery.SQL.Add(SQLStr);
  CustomDM.PubQuery.Parameters.ParamValues['a'] :=Trim(Edit1.Text);
  CustomDM.PubQuery.Parameters.ParamValues['b'] :=Trim(Edit2.Text);
  CustomDM.PubQuery.Parameters.ParamValues['c'] :=Trim(Form.Hint);
  CustomDM.PubQuery.ExecSQL;
end;FORM2有一个BUTTON1为“修改”,代码如下:begin
  if DBGrid1.DataSource.DataSet.IsEmpty then
  begin
    MsgBox('请选择记录!');
    Abort;
  end;
  Form1 := TForm1.Create(Application);
  try
    Form1.Edit1.Text := CustomDM.Adoquery['字段1'];
    Form1.Edit2.Text := CustomDM.Adoquery['字段2'];
    Form1.Hint := CustomDM.ADOQuery['标识'];
    Form1.Tag :=1;
  finally
    Form1.Free;
    Form1 := nil;
  end;问题:此代码在单机没有问题,但在多个计算机同时录入修改数据时,出现问题,更新的并非是查询的记录。请大家帮忙解决。