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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no warning empty row form 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
I have a delete command on each row of a subform. It works fine. If the users clicks an empty row access giving an error dialog box to say that he can not delete an empty row.

How can I say, if it is a empty row do nothing and do not show an error dialog box (docmd.setwarnings false ?).

Code:
Forms!F01_ORDER!FS_T02_ORDER.SetFocus
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
 
Test the value of the PK control.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Perhaps something like this:
Code:
If Trim(Forms!F01_ORDER!FS_T02_ORDER & "") <> "" Then
  DoCmd.RunCommand acCmdDeleteRecord
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I need to check if there is a record, an empty record requires no action. PHV, one your action he is complaining and on my code trial below also. What is missing ?

Code:
If IsNull(Forms!F01_ORDER!FS_T02_ORDER) Then
Else
DoCmd.SetWarnings False
  DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top