Ok I feel so dumb....I found out what the issue is....I should have been using AND instead of OR.
Below is the code that ended up working.
ElseIf (Len(Nz(Me.Associate_name, "")) = 0)
and (Me.Status <> "Expired")
and (Me.Status <> "No longer eligible") Then
I get very confused when...
Mihail I tried as you suggested on both parts of the formula and it works when I use only one part, but as soon as I add them together with the OR it does not work.
ElseIf (Len(Nz(Me.Associate_name, "")) = 0) And (Me.Status <> "Expired") Or (Len(Nz(Me.Associate_name, "")) = 0) And (Me.Status...
After removing the Nz neither part of the formula works. I am ok with leaving the Nz as is, but just have to figure out how to make the 2 parts work together.
Ok I have tried the second part of the formula and it works as shown below. I am not getting an error message when I use both parts of the formula, but the issue is that the code will return the message box regardless of field values.
ElseIf (Len(Nz(Me.Associate_name, "")) = 0 And Me.Status...
I am having some issues trying to use both and & or in a If statement.
The code below is what I am trying to do and it is not working.
ElseIf (Len(Nz(Me.Associate_name, "")) = 0 And Me.Status <> "Expired") Or (Len(Nz(Me.Associate_name, "")) = 0 And Me.Status <> "No longer eligible") Then...
After I put in Forms After Update event Me.AllowAdditions = False I get runtime error 2105 and the debug points to DoCmd.GoToRecord acActiveDataObject, , acNewRec
That is the issue I was having initially.
I just realized that the code works, but does not set Me.AllowAdditions = False after the new record is added....so after the first time the command button is clicked users can add new records without having to use the command button.
If possible I would like for the following to happen when...
I spoke too soon...I have both the Master and Child set to SalespersonID and it still has the same issue.
The subform is blank on a new record, but as soon as I type in the 1st field the subform populates with data from the last record.
I have a form that contains order information with the salesperson id.
At the bottom of the form I have a subform which displays all the records (orders) of the unique sales person based on the salesperson id that is entered on the record.
Once the salesperson id is entered I am running an...
bob fitz....you are correct....I set the Allow Addition = No and removed the On Current and used only your code and it worked.
Thank you bob fitz and Catalina!
I tried that and it still gives me the error.
I seem to be getting a little closer. Ok I verified I have Allow Additions = Yes under form properties, and get the error using the code below.
Private Sub Form_Current()
Me.AllowAdditions = False
End Sub
Private Sub All_Load_Click()...