[AccessD] Problem with Form_Current() - Access 2003 SP3

Bob Gajewski rbgajewski at roadrunner.com
Mon May 12 06:34:39 CDT 2008


Hi
 
I am having a problem with some Form_Current() code. For an address table, I
have certain fields that I don't want to display if the VACANT flag is set
to true. The code works fine in the _AfterUpdate() module, but not in the
_Current module - and I basically copied from one to the other. I do have
other display control code in the _Current() module that works fine. Field
"CardexVacantFlag" is a checkbox with TripleState set to No.
 
Any suggestions are gratefully appreciated.
 
TIA
Bob Gajewski
 
 
Private Sub Form_Current()
If CardexVacantFlag = True Then
    CardexOccupantLastName.Visible = False
    CardexOccupantFirstName.Visible = False
    CardexOccupantBusinessName.Visible = False
    CardexOccupantHouseNumber.Visible = False
    CardexOccupantStreetID.Visible = False
    CardexOccupantAddlInfo.Visible = False
    CardexOccupantPOBox.Visible = False
    CardexOccupantMunicipalityID.Visible = False
    CardexOccupantStateCode.Visible = False
    CardexOccupantZipCode.Visible = False
    CardexOccupantMailingListFlag = False
    CardexOccupantMailingListFlag.Visible = False
    CardexOccupantSpecialNeeds.Visible = False
    CardexOccupantChildren.Visible = False
    CardexOccupantPets.Visible = False
    CardexOccupantAnimals.Visible = False
Else
    CardexOccupantLastName.Visible = True
    CardexOccupantFirstName.Visible = True
    CardexOccupantBusinessName.Visible = True
    CardexOccupantHouseNumber.Visible = True
    CardexOccupantStreetID.Visible = True
    CardexOccupantAddlInfo.Visible = True
    CardexOccupantPOBox.Visible = True
    CardexOccupantMunicipalityID.Visible = True
    CardexOccupantStateCode.Visible = True
    CardexOccupantZipCode.Visible = True
    CardexOccupantMailingListFlag.Visible = True
    CardexOccupantSpecialNeeds.Visible = True
    CardexOccupantChildren.Visible = True
    CardexOccupantPets.Visible = True
    CardexOccupantAnimals.Visible = True
End If
If IsNull(CardexWarningReason) Then
    lblCardexWarning.Visible = False
Else
    lblCardexWarning.Visible = True
    DoCmd.Beep
End If
End Sub
-------------------------
 
Private Sub CardexVacantFlag_AfterUpdate()
If CardexVacantFlag = True Then
    CardexOccupantLastName = Null
    CardexOccupantLastName.Visible = False
    CardexOccupantFirstName = Null
    CardexOccupantFirstName.Visible = False
    CardexOccupantBusinessName = Null
    CardexOccupantBusinessName.Visible = False
    CardexOccupantHouseNumber = Null
    CardexOccupantHouseNumber.Visible = False
    CardexOccupantStreetID = Null
    CardexOccupantStreetID.Visible = False
    CardexOccupantAddlInfo = Null
    CardexOccupantAddlInfo.Visible = False
    CardexOccupantPOBox = Null
    CardexOccupantPOBox.Visible = False
    CardexOccupantMunicipalityID = Null
    CardexOccupantMunicipalityID.Visible = False
    CardexOccupantStateCode = Null
    CardexOccupantStateCode.Visible = False
    CardexOccupantZipCode = Null
    CardexOccupantZipCode.Visible = False
    CardexOccupantMailingListFlag = False
    CardexOccupantMailingListFlag.Visible = False
    CardexOccupantSpecialNeeds = Null
    CardexOccupantSpecialNeeds.Visible = False
    CardexOccupantChildren = Null
    CardexOccupantChildren.Visible = False
    CardexOccupantPets = Null
    CardexOccupantPets.Visible = False
    CardexOccupantAnimals = Null
    CardexOccupantAnimals.Visible = False
Else
    CardexOccupantLastName.Visible = True
    CardexOccupantFirstName.Visible = True
    CardexOccupantBusinessName.Visible = True
    CardexOccupantHouseNumber.Visible = True
    CardexOccupantStreetID.Visible = True
    CardexOccupantAddlInfo.Visible = True
    CardexOccupantPOBox.Visible = True
    CardexOccupantMunicipalityID.Visible = True
    CardexOccupantStateCode.Visible = True
    CardexOccupantZipCode.Visible = True
    CardexOccupantMailingListFlag.Visible = True
    CardexOccupantSpecialNeeds.Visible = True
    CardexOccupantChildren.Visible = True
    CardexOccupantPets.Visible = True
    CardexOccupantAnimals.Visible = True
End If
LastUpdated = Date
End Sub

 
P Please consider the environment before printing this e-mail 
 



More information about the AccessD mailing list