Re: Visible Properties

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Swansea" <Swansea@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6543AA4D-4386-4CDF-AD7B-0C1E8FD1714D@xxxxxxxxxxxxx
> I have a form field called Orders and another field called Supplier.
> How do I make the Supplier field Invisible except when selected
> Orders are entered into the Orders Field?

You can't easily do this on a continuous form, though there are tricks
you can use to get around the problem. If your form is in single-form
view, however, you can use code in the form's Current event and the
AfterUpdate event of the Orders control to set the visibility of the
Supplier field. For (simple) example:

Private Sub SetSupplierVisibility()

Select Case Me!Orders
Case "a", "b", "c"
Me!Supplier.Visible = True
Case Else
Me!Supplier.Visible = False
End Select

End Sub

Private Sub Form_Current()
SetSupplierVisibility
End Sub

Private Sub Orders_AfterUpdate()
SetSupplierVisibility
End Sub


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.



Relevant Pages

  • Re: Visible Properties
    ... >> How do I make the Supplier field Invisible except when selected ... > AfterUpdate event of the Orders control to set the visibility of the ... > Private Sub SetSupplierVisibility() ... > Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.forms)
  • Re: Go to Control with IIf statement
    ... The code doesn't go in the "Form" AfterUpdate event. ... MsgBox "Must fill in Approved Pantone Number", ... Candia Computer Consulting. ... Private Sub Form_AfterUpdate ...
    (microsoft.public.access.formscoding)
  • Re: spell checking error
    ... >Private Sub Resolution_AfterUpdate ... >> and BeforeUpdate event procedures. ... >> text box shouldn't have a BeforeUpdate procedure. ... >>>> Try moving the code to the control's AfterUpdate event. ...
    (microsoft.public.access.formscoding)
  • Re: Word equals color
    ... used on the top and bottom of 3x (tab) forms for the same record. ... the typed in information updates and only the first form ... Private Sub ColorClassification ... Then, I would put code in the combo boxes AfterUpdate event, and the forms ...
    (microsoft.public.access.formscoding)
  • Re: Message box when data is entered in a form
    ... Private Sub Form_OnUpdate ... AfterUpdate event for the form (make sure it's the form, ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.forms)