Help with if statement (1 Viewer)

Marinus

I'm learning... :)
Local time
Today, 08:46
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..
 

John Big Booty

AWF VIP
Local time
Today, 17:46
Joined
Aug 29, 2005
Messages
8,262
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
 

Marinus

I'm learning... :)
Local time
Today, 08:46
Joined
Jun 16, 2010
Messages
140
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..
 

vbaInet

AWF VIP
Local time
Today, 08:46
Joined
Jan 22, 2010
Messages
26,374
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)
 

Marinus

I'm learning... :)
Local time
Today, 08:46
Joined
Jun 16, 2010
Messages
140
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

Top Bottom