Adding a number to a field on a form

Les Blair

Registered User.
Local time
Today, 10:32
Joined
Sep 10, 2007
Messages
49
I need to add a +1 to the seq number of a record on a table when I insert the record to the table. The following is the code I am using can someone please tell me where I have gone wrong?

If Me.txtCaseType = "SBD" Then
DoCmd.OpenForm "frmSBDAmendments", WhereCondition:=strLinkCriteria
Forms!frmSBDAmendments![Seq #] = "Forms!frmSBDAmendments![Seq #] + 1"
End If

In the above I am checking on the current form to see if a field (txtCaseType) is equal to "SBD" if it is then I am opening a form called frmSBDAmendments that is equal to the strLinkCriteria ([Case Track Nbe] = '25116') once I open it I need to increment the Seq # on frmSBDAmendments by +1. If it is null I need to insert a 1. the field is defined as 'NUMBER','DOUBLE'.
 
The quotes around your value mean that you're passing the literal string "Forms...", not a value.
 

Users who are viewing this thread

Back
Top Bottom