Help with if statement

Marinus

I'm learning... :)
Local time
Today, 17:07
Joined
Jun 16, 2010
Messages
140
Hi All, Would like to ask for some advise, I have two subforms that I make visible when needed, now I would like to cycle a third form sfrmQryBuyUpdate. This form is depending on Me.DM False or True and should have priority over the two mentioned in the code..

Code:
If Me.Sale = True Then
    Me.sfrmQrySellTouch.Visible = True
    Me.sfrmQryBuyTouch.Visible = False
Else
    Me.sfrmQryBuyTouch.Visible = True
    Me.sfrmQrySellTouch.Visible = False
End If

Any ideas greatly appreciated..
 
You could try;
Code:
If Me.Dm = True Then
     Me.sfrmQryBuyUpdate.Visible = True
     Me.sfrmQrySellTouch.Visible = False
     Me.sfrmQryBuyTouch.Visible = False
ElseIf Me.Sale = True Then
     Me.sfrmQrySellTouch.Visible = True
     Me.sfrmQryBuyTouch.Visible = False
     Me.sfrmQryBuyUpdate.Visible = False
Else
    Me.sfrmQryBuyTouch.Visible = True
    Me.sfrmQrySellTouch.Visible = False
    Me.sfrmQryBuyUpdate.Visible = False
End If
 
Thanks John, this gives some strange behaviour, I think something has to be added to this statement, however I have a splitting headache so I will look at this tomorrow when I can concentrate. Will let you know..
 
What do you mean by "should have priority"?
Code:
    Me.sfrmQryBuyUpdate.Visible = Nz(Me.DM, False)
    Me.sfrmQrySellTouch.Visible = nz(Me.Sale, False)
    Me.sfrmQryBuyTouch.Visible = Not nz(Me.Sale, False)
 
What do you mean by "should have priority"?
Code:
    Me.sfrmQryBuyUpdate.Visible = Nz(Me.DM, False)
    Me.sfrmQrySellTouch.Visible = nz(Me.Sale, False)
    Me.sfrmQryBuyTouch.Visible = Not nz(Me.Sale, False)


Hi vbaInet, thanks for looking and suggestion..
Me.DM is the first check that should be done, it contains the records that are not priced yet, when priced they show up as Buy or Sell.. Will sign off for the night .. Paracetamol was no help.. Coding when sick is not a good idea..
Will try tomorrow..
 

Users who are viewing this thread

Back
Top Bottom