Kamis, 15 Maret 2012

[MS_AccessPros] RE: Crystal, I've lost an old email and

 

I found it Crystal!

'~~~~~~~~~~~~~~~~~~~~~~~

Function GetVisible_LotNum( _
pReference As String _
, pSNRequired As String _
, pPNQTY As Double _
, pIsCd As String _
) As Boolean

GetVisible_LotNum = False

Select Case Left(pReference, 2)
Case "BA", "EK", "DL", "ET"
If Trim(pSNRequired) = "Y" And pPNQTY > 0 Then
GetVisible_LotNum = True
End If
Case Else
If (pIsCd = "I" And pPNQTY > 0) Then
GetVisible_LotNum = True
'Me.SN.Visible = False
End If
End Select
End Function
'~~~~~~~~~~~~~~~~~~~~~~~
Function GetVisible_SN( _
pReference As String _
, pSNRequired As String _
, pPNQTY As Double _
, pIsCd As String _
) As Boolean

If (pIsCd = "I" And pPNQTY > 0) Then
GetVisible_SN = False
Else
GetVisible_SN = GetVisible_LotNum(pReference, pSNRequired, pPNQTY, pIsCd)
End If
End Select
End Function
'~~~~~~~~~~~~~~~~~~~~~~~
NOTE:
Ideally, parameters will be validated before they are tested ~~

then in the SQL for the form RecordSource, add these 2 calculated fields:

VisLot: GetVisible_LotNum([Ref], [SNRequired], [PNQTY], [IsCd])

VisSN: GetVisible_SN ([Ref], [SNRequired], [PNQTY], [IsCd])

test VisLot and VisSN, which both equate to True or False, for your conditional formatting rules.

Conditional formatting must be applied to each control. So the function that controls the visibility of LotNum would be:

IIF(VisLot=true, true, false)

Liz Ravenwood
Database Developer / Programmer
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Liz Ravenwood
Sent: Thursday, March 15, 2012 2:21 PM
To: 'MS_Access_Professionals@yahoogroups.com'
Subject: [MS_AccessPros] Crystal, I've lost an old email and

Crystal, some time ago you had some brilliant code for a field of mine to function by conditional formatting based on a true/false value and then the function that the query as the recordsource calls.

I've got something broken and failed to keep the body of your email as documentation (woops) and need your help again if you could please.

I've got this: =IIf([VisSN]=True,True,False) in my field onclick event which makes no sense and I think something got skewampled.

Do you remember?

Liz Ravenwood
Database Developer / Programmer
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

------------------------------------

Yahoo! Groups Links

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar