Re: not equal to

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you Greg. This seems a little advanced for me. I solved the problem for
now like this

IF "my command below"
exit sub (thus nothing happens and the sentence stays where I want it to stay)
ELSE "delete sentence I wanted to delete".

So, if I user chooses AAA in DD1 OR in DD2, the sentence stays. If user
chooses anything else than AAA, sentence is erased.

Thx again for your quick reply.
--
Merci/Thank you.


"Greg Maxey" wrote:


Not sure I understand exactly what you are looking for, but one of the two
OR or AND functions illustrated below should work:

Sub ScratchMacro()
Dim pAstr As String
Dim pBStr As String
pAstr = "AAA"
pBStr = "AZA"
If Not pAstr = "AAA" Or Not pBStr = "AAA" Then
MsgBox "Do this"
Else
MsgBox "Do that"
End If
If Not pAstr = "AAA" And Not pBStr = "AAA" Then
MsgBox "Do this"
Else
MsgBox "Do that"
End If
End Sub

C''''est_moi wrote:
Again, in dire need of help. I need to have a sentence disappear if
the result of two different DD (each with 10 choices in them) is NOT
equal to something (both results are the same, below "AAA").

If ActiveDocument.FormFields("xxx").Result = "AAA" Or
ActiveDocument.FormFields("yyy") = "AAA" then

That is the command that I came up with and which works perfectly
fine in erasing my sentence but I want the contrary. I tried adding

= false

at the end but that does not work either. And I cannot find any "is
not equal to" command.

Merci/Thank you for any help anyone can provide.

Carmen

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org




.



Relevant Pages

  • Re: Opening a serial port and print something in it
    ... txtMsg, and two command buttons, one to start the comms, and one to stop it. ... Private Sub cmdComm_Click ... MsgBox Err.Description ...
    (microsoft.public.access.formscoding)
  • Re: Popup Menu / Shortcut Menu
    ... Does the code creating the command bar have to be run every time my ... Sub CreateMenuItems() ... Dim Ctrl As Office.CommandBarControl ... MsgBox "AAA" ...
    (microsoft.public.excel.misc)
  • RE: Form Coding Not Running Properly.
    ... > I have a userform with a command button and a drop down on it. ... > behind the form acts differently, depending upon the method of running it. ... > Sub Change_Number ... > MsgBox ...
    (microsoft.public.publisher)
  • Re: Unable to call Module?
    ... > 'SaveCloseForm' module, which will attempt to save the record, and, ... > behind the Command Button: ... > Private Sub CommandCloseAndSave_Click ... > MsgBox "You must enter a value into Patient Number." ...
    (microsoft.public.access.formscoding)
  • Re: Deployment ??
    ... "Greg" wrote in message ... > I am new to VB6 so please go easy. ... > Must have startup form or Sub MainBuild of 'move_zlb.exe' failed. ... you need to read the command line use the Command$ function ...
    (microsoft.public.vb.general.discussion)