OK I have figured it out::sign0060:
ErrorLabel (DupPoints)
If PntName.Text<>"" Then
If CFile=0 Then
text="update LCoords Set YCoord = '"
Else If CFile=1 Then
text="update LCoords Set YCoord = '"
Else
text="update LCoords Set YCoord = '"
End If
Text=Text & YCoord.Text & "'," & "XCoord = '" & XCoord.Text & "'," & "ZCoord = '" & ZCoord.Text
Text=Text & "'," & "Description = '" & Descrip.Text & "'"
Text=Text & " where PntName = '" & PntName.Text &"'"
cmd.CommandText=text
A=cmd.ExecuteNonQuery
If A=0 Then Goto DupPoints
Return
Else
Msgbox ("Enter A Valid Point Name", "Point Name", cMsgboxOK, cMsgboxExclamation)
PntName.Focus
Return
End If
DupPoints:
'The name does not exist so add the new data
If CFile=0 Then
text="insert into LCoords (PntName,YCoord,XCoord,ZCoord,Description) values ('"
Else If CFile=1 Then
text="insert into GCoords (PntName,YCoord,XCoord,ZCoord,Description) values ('"
Else
text="insert into SCoords (PntName,YCoord,XCoord,ZCoord,Description) values ('"
End If
text=text & PntName.Text & "','" & YCoord.Text & "','" & XCoord.Text & "','" & ZCoord.Text & "','" & Descrip.Text & "')"
cmd.CommandText=text
cmd.ExecuteNonQuery
A will be "1" be the point exists in which case I update the data, else if A is "0" then the point does not exists and I insert a new field.
Thanks
Michael