Two questions............

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

1.) I have a subform on which certain fields are hidden. Depending on some
choices you make some firelds get visible.

f.e. if the option Discount (YES/NO) (Korting in dutch) is set to yes
certain fields get hidden, others get visible and some values are adapted.
This works all fine but when I leave the record and browse through some
record, afterwards returning to the first record all the fields are hidden.
Discount is still set to YES and I can see by the endresults that the right
calculation is performed. So it is just a matter of visibility. If I change
the field discount to NO and then back to yes it works fine. So I guess I
need to put that code so that it executes at loading a record. But it
doesn't!
I put in a msgbox "test", vbokonly in the part that would have to make the
fields visible and I see the msgbox TEST but the fields do not get visible.
Furthermore, I do not seen the msgbox on opening a record but on CLOSING if
I changed anything. What is the right place to execute code if the record
(not the form) gets reloaded?
Can someone plz have a look at this?

2.) I have an table 'agenda' that contains all the onformation to create a
weekcalendar containing all appointments for a group of people. Filling up
the agenda, everything works fine but I cannot seem to create an agenda. I
have an XLS example of how it should look but I see no way opf reproducing
it in Access. Can someone help me out on this one too?

TIA Henro
 
I think I am using the wrong event, which os the right one?

Code below for those that are interested

If Me("SolvsON") = "Geen" Then

'Weergave Vaste SchermItems
Me.TotaleKosten_Bijschrift.Visible = False
Me.KortingVerleend_Bijschrift.Visible = False
Me.TeBetalen_Bijschrift.Visible = False
Me.NetwerkInstallatie_Bijschrift.Visible = False
Me.ONNetwerkInstallatie.Visible = False

'Weergave ON StandAlone
Me.ONSATarief_Bijschrift.Visible = False
Me.ONSATarief.Visible = False
Me.Kortingverleend.Visible = False
Me.KostenSA.Visible = False
Me.BetalenSA.Visible = False

' Weergave ON NetwerkInstallatie
Me.ONAantalClients_Bijschrift.Visible = False
Me.ONTariefperClient_Bijschrift.Visible = False
Me.ONNetwerkTarief_Bijschrift.Visible = False
Me.ONAantalClients.Visible = False
Me.ONTariefperClient.Visible = False
Me.ONNetwerkTarief.Visible = False
Me.KostenONNetwerk.Visible = False
Me.Kortingverleend.Visible = False
Me.BetalenNetwerk.Visible = False

' Weergave SOL
Me.SOLBestedeUren_Bijschrift.Visible = False
Me.SOLUurtarief_Bijschrift.Visible = False
Me.SOLVoorrijkosten_Bijschrift.Visible = False
Me.SOLBestedeUren.Visible = False
Me.SOLUurtarief.Visible = False
Me.SOLVoorrijkosten.Visible = False
Me.SOLTotaalkosten.Visible = False
Me.KortingVerleendSOL.Visible = False
Me.SOLTotaal.Visible = False

' Weergave Overige
Me.Overige.Visible = False


ElseIf Me("SolvsON") = "ON" Then


' Weergave vaste schermItems
Me.TotaleKosten_Bijschrift.Visible = True
Me.KortingVerleend_Bijschrift.Visible = True
Me.TeBetalen_Bijschrift.Visible = True
Me.NetwerkInstallatie_Bijschrift.Visible = True
Me.ONNetwerkInstallatie.Visible = True


' Weergave ON StandAlone
Me.ONSATarief_Bijschrift.Visible = True
Me.ONSATarief.Visible = True
Me.Kortingverleend.Visible = True
Me.KostenSA.Visible = True
Me.KortingSA.Visible = True
Me.BetalenSA.Visible = True

' Weergave ON NetwerkInstallatie
Me.ONAantalClients_Bijschrift.Visible = False
Me.ONTariefperClient_Bijschrift.Visible = False
Me.ONNetwerkTarief_Bijschrift.Visible = False
Me.ONAantalClients.Visible = False
Me.ONTariefperClient.Visible = False
Me.ONNetwerkTarief.Visible = False
Me.KostenONNetwerk.Visible = False
Me.Kortingverleend.Visible = False
Me.BetalenNetwerk.Visible = False


' Weergave SOL
Me.SOLBestedeUren_Bijschrift.Visible = False
Me.SOLUurtarief_Bijschrift.Visible = False
Me.SOLVoorrijkosten_Bijschrift.Visible = False
Me.SOLBestedeUren.Visible = False
Me.SOLUurtarief.Visible = False
Me.SOLVoorrijkosten.Visible = False
Me.SOLTotaalkosten.Visible = False
Me.KortingVerleendSOL.Visible = False
Me.SOLTotaal.Visible = False

' Weergave Overige
Me.Overige.Visible = False


ElseIf Me("SolvsON") = "Sol" Then

' Weergave vaste schermItems
Me.TotaleKosten_Bijschrift.Visible = True
Me.KortingVerleend_Bijschrift.Visible = True
Me.TeBetalen_Bijschrift.Visible = True
Me.NetwerkInstallatie_Bijschrift.Visible = True
Me.ONNetwerkInstallatie.Visible = False

' Weergave ON StandAlone
Me.ONSATarief_Bijschrift.Visible = False
Me.ONSATarief.Visible = False
Me.Kortingverleend.Visible = False
Me.KostenSA.Visible = False
Me.KortingSA.Visible = False
Me.BetalenSA.Visible = False

' Weergave ON NetwerkInstallatie
Me.ONAantalClients_Bijschrift.Visible = False
Me.ONTariefperClient_Bijschrift.Visible = False
Me.ONNetwerkTarief_Bijschrift.Visible = False
Me.ONAantalClients.Visible = False
Me.ONTariefperClient.Visible = False
Me.ONNetwerkTarief.Visible = False
Me.KostenONNetwerk.Visible = False
Me.Kortingverleend.Visible = False
Me.BetalenNetwerk.Visible = False


' Weergave SOL
Me.SOLBestedeUren_Bijschrift.Visible = True
Me.SOLUurtarief_Bijschrift.Visible = True
Me.SOLVoorrijkosten_Bijschrift.Visible = True
Me.SOLBestedeUren.Visible = True
Me.SOLUurtarief.Visible = True
Me.SOLVoorrijkosten.Visible = True
Me.SOLTotaalkosten.Visible = True
Me.KortingVerleendSOL.Visible = True
Me.SOLTotaal.Visible = True

' Weergave Overige
Me.Overige.Visible = False


ElseIf Me("SolvsON") = "Overige" Then

' Weergave vaste schermItems
Me.TotaleKosten_Bijschrift.Visible = False
Me.KortingVerleend_Bijschrift.Visible = False
Me.TeBetalen_Bijschrift.Visible = True
Me.NetwerkInstallatie_Bijschrift.Visible = False
Me.ONNetwerkInstallatie.Visible = False

' Weergave ON StandAlone
Me.ONSATarief_Bijschrift.Visible = False
Me.ONSATarief.Visible = False
Me.Kortingverleend.Visible = False
Me.KostenSA.Visible = False
Me.KortingSA.Visible = False
Me.BetalenSA.Visible = False

' Weergave ON NetwerkInstallatie
Me.ONAantalClients_Bijschrift.Visible = False
Me.ONTariefperClient_Bijschrift.Visible = False
Me.ONNetwerkTarief_Bijschrift.Visible = False
Me.ONAantalClients.Visible = False
Me.ONTariefperClient.Visible = False
Me.ONNetwerkTarief.Visible = False
Me.KostenONNetwerk.Visible = False
Me.Kortingverleend.Visible = False
Me.BetalenNetwerk.Visible = False

'Weergave SOL
Me.SOLBestedeUren_Bijschrift.Visible = False
Me.SOLUurtarief_Bijschrift.Visible = False
Me.SOLVoorrijkosten_Bijschrift.Visible = False
Me.SOLBestedeUren.Visible = False
Me.SOLUurtarief.Visible = False
Me.SOLVoorrijkosten.Visible = False
Me.SOLTotaalkosten.Visible = False
Me.KortingVerleendSOL.Visible = False
Me.SOLTotaal.Visible = False

' Weergave Overige
Me.Overige.Visible = True


End If

'Gebilled:

If Me.Gebilled = True Then
MsgBox "Gebilled true", vbkonly
Me.TextGebilled.Visible = True

Else
Me.TextGebilled.Visible = False

End If


'Korting:

If Me.Korting = True Then
MsgBox "korting true", vbkonly
Me.KortingAbsoluut.Visible = True
Me.KortingAbsoluut_Bijschrift.Visible = True
Me.KortingRelatief.Visible = True
Me.KortingRelatief_Bijschrift.Visible = True
Me.ProcentKorting_Bijschrift.Visible = True


End If


'OnTerecht:

If Me.OnTerecht = True Then
MsgBox "oNTERECHT true", vbkonly
Me.Stoplicht.Visible = True
Me.Redenonterecht.Visible = True
Me.RedenOnterecht_Bijschrift.Visible = True

Else
Me.Stoplicht.Visible = False
Me.Redenonterecht.Visible = False
Me.RedenOnterecht_Bijschrift.Visible = False

End If

'KTO:

If Me.KTOOntvangen = True Then
MsgBox "KTO true", vbkonly
Me.EvaluatieCijfer.Visible = True
Me.EvaluatieCijfer_Bijschrift.Visible = True

Else
Me.EvaluatieCijfer.Visible = False
Me.EvaluatieCijfer_Bijschrift.Visible = False

End If

'NetwerkON:

If Me.ONNetwerkInstallatie = True Then
MsgBox "Netwerk true", vbkonly
'StandAlone velden

Me.ONSATarief_Bijschrift.Visible = False
Me.ONSATarief.Visible = False
Me.Kortingverleend.Visible = False
Me.KostenSA.Visible = False
Me.KortingSA.Visible = False
Me.BetalenSA.Visible = False

'Netwerk Velden

Me.ONAantalClients.Visible = True
Me.ONAantalClients_Bijschrift.Visible = True
Me.ONTariefperClient.Visible = True
Me.ONTariefperClient_Bijschrift.Visible = True
Me.ONNetwerkTarief.Visible = True
Me.ONNetwerkTarief_Bijschrift.Visible = True
Me.KostenONNetwerk.Visible = True
Me.BetalenNetwerk.Visible = True
Me.Kortingverleend.Visible = True




Else

'StandAlone velden

Me.ONSATarief_Bijschrift.Visible = True
Me.ONSATarief.Visible = True
Me.Kortingverleend.Visible = True
Me.KostenSA.Visible = True
Me.KortingSA.Visible = True
Me.BetalenSA.Visible = True


'Netwerk Velden

Me.ONAantalClients.Visible = False
Me.ONAantalClients_Bijschrift.Visible = False
Me.ONTariefperClient.Visible = False
Me.ONTariefperClient_Bijschrift.Visible = False
Me.ONNetwerkTarief.Visible = False
Me.ONNetwerkTarief_Bijschrift.Visible = False
Me.KostenONNetwerk.Visible = False
Me.BetalenNetwerk.Visible = False
Me.Kortingverleend.Visible = False


End If

'Kantoor:

If Me.KantoorBetaald = True Then
MsgBox "Kantoor true", vbkonly
Me.BONummer.Visible = True
Me.BONummer_Bijschrift.Visible = True
Me.Akkoord_door.Visible = True
Me.Akkoorddoor_Bijschrift.Visible = True
Me.Akkoorddatum.Visible = True
Me.Akkoorddatum_Bijschrift.Visible = True
Else
Me.BONummer.Value = Null
Me.BONummer.Visible = False
Me.BONummer_Bijschrift.Visible = False
Me.Akkoord_door.Visible = False
Me.Akkoorddoor_Bijschrift.Visible = False
Me.Akkoorddatum.Visible = False
Me.Akkoorddatum_Bijschrift.Visible = False
End If

End Sub
 
Back
Top