G
Guest
After reading through a number of Newsgroup dialogue's I've 'almost' got my
problem licked. A little more help at this stage would really be appreciated.
I have several subforms that I've linked to a master/parent form and this
all seems to be working well. What I am now trying to do is to be able to
change a field ('PetType') in one subform ("A") and then when I click on the
tab to go to a different subform ("B") it will read the changed field and
either hide or unhide some of the controls on the form ("B"). Part of the
code I've written to do this looks like:
If Forms!SPCA!PetInfo.Form!PetType = "Dog" Then
Me.CatFIVFeleukCombo.Visible = False
Me.CatFVRCP.Visible = False
Me.CatFeleukVacc.Visible = False
Me.FEBOOSTER.Visible = False
Me.DogDHLPP.Visible = True
Me.DogKenCough.Visible = True
End If
This code is in the On Current event in "B". PetInfo is subform "A".
My problem is that the 'visible' code lines above work fine when I first go
into a record but nothing changes when I'm actually in the record on subform
'A', change the PetType field and then use the tab to go to subform 'B'.
I've experimented with docmd.requery and me.requery, placing them in various
other events, but don't seem to be able to get it quite right.
problem licked. A little more help at this stage would really be appreciated.
I have several subforms that I've linked to a master/parent form and this
all seems to be working well. What I am now trying to do is to be able to
change a field ('PetType') in one subform ("A") and then when I click on the
tab to go to a different subform ("B") it will read the changed field and
either hide or unhide some of the controls on the form ("B"). Part of the
code I've written to do this looks like:
If Forms!SPCA!PetInfo.Form!PetType = "Dog" Then
Me.CatFIVFeleukCombo.Visible = False
Me.CatFVRCP.Visible = False
Me.CatFeleukVacc.Visible = False
Me.FEBOOSTER.Visible = False
Me.DogDHLPP.Visible = True
Me.DogKenCough.Visible = True
End If
This code is in the On Current event in "B". PetInfo is subform "A".
My problem is that the 'visible' code lines above work fine when I first go
into a record but nothing changes when I'm actually in the record on subform
'A', change the PetType field and then use the tab to go to subform 'B'.
I've experimented with docmd.requery and me.requery, placing them in various
other events, but don't seem to be able to get it quite right.