Show field on form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am new to access. One of the fields on my form is a dropdown box with the options of certified & Non-Certified. I have follow up fields on the form which only apply when a record is listed as certified. how can I make the following fields show up only if i choose in the drop down box Certified?
 
It might be best to set up a subform with those fields and make i
visible only if 'certified' is chosen

avalon_to
 
Hi,
I am new to access. One of the fields on my form is a dropdown box with the options of certified & Non-Certified. I have follow up fields on the form which only apply when a record is listed as certified. how can I make the following fields show up only if i choose in the drop down box Certified?

Code the Current event and also the Combo Box AfterUpdate event:
[ControlA].Visible = ComboName = "Certified"
[ControlB].Visible = ComboName = "Certified"
Etc.

The above assumes that the bound column of the Combo box is Text
datatype.
 
Hi,
I am new to access. One of the fields on my form is a dropdown box with the options of certified & Non-Certified. I have follow up fields on the form which only apply when a record is listed as certified. how can I make the following fields show up only if i choose in the drop down box Certified?

You'll need a little bit of VBA code to do this, in two places: the
AfterUpdate event of this combo box, and the form's Current event.
Something like:

Private Sub cboCertified_AfterUpdate()
If Me.cboCertified = "Certified" Then
Me.controlname.Enabled = True
Me.anothercontrol.Enabled = True
Else
Me.controlname.Enabled = False
Me.anothercontrol.Enabled = False
End If

Put the same code in the Current event so that when you navigate to a
new record the controls are appropriately enabled or disabled.
 
Thank You for your quick reply
I put the code in the after update section and it gave me an error message about debugging

I couldnt find where to put the code in Current Update

----- John Vinson wrote: ----

On Fri, 6 Feb 2004 13:26:10 -0800, Da
Hi
I am new to access. One of the fields on my form is a dropdown box with the options of certified & Non-Certified. I have follow up fields on the form which only apply when a record is listed as certified. how can I make the following fields show up only if i choose in the drop down box Certified

You'll need a little bit of VBA code to do this, in two places: th
AfterUpdate event of this combo box, and the form's Current event
Something like

Private Sub cboCertified_AfterUpdate(
If Me.cboCertified = "Certified" The
Me.controlname.Enabled = Tru
Me.anothercontrol.Enabled = Tru
Els
Me.controlname.Enabled = Fals
Me.anothercontrol.Enabled = Fals
End I

Put the same code in the Current event so that when you navigate to
new record the controls are appropriately enabled or disabled

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=publi
 
Thank You for your quick reply,
I put the code in the after update section and it gave me an error message about debugging.

Please post the actual code and the error message. "an error message
about debugging" doesn't convey any useful information to me!
I couldnt find where to put the code in Current Update.

Open the Form in design view; view its Properties. One of the
properties on the Events tab is the Current event. Click the ... icon
to open the VBA editor and edit the code into that event.
 
Ok Ive got that down. For my Certified combobox it works. But here goes another question along the same line

I am attempting to do the same on another part of the form. I have two combo boxes one is "Half or Full" with choices "AM" "PM" "Full" and the second Combo box is "Location" with choices "Pico" Robertson" "Marina Del Rey" further down the form I have an "AM Classroom" "PM Classroom" for each one of the above locations.

What i am trying to do is if someone selects "AM" and location "Robertson" then only the AM classroom by Robertson will show. "PM" and location "Robertson" then only the PMclassroom by Robertson will show. "Full" and location "Robertson" then both the AM and PM classrooms by Robertson will show. And the same for each location

I have tried to follow your instructions just changing the field name with first working on the "Half or Full" field. I can get it to work for "AM' for "PM" but when I try to put in Full nothing shows, This I am assuming because Neither "AM" Nor "PM" appear in the field

How can I get around this

Once i throw "Location" in everything goes haywire, what do i do about that

Lastly i found where to copy the code in Current Update, Where would I copy this new code

Thank Yo
----- John Vinson wrote: ----

On Sun, 8 Feb 2004 21:31:05 -0800, Da
Thank You for your quick reply
I put the code in the after update section and it gave me an error message about debugging

Please post the actual code and the error message. "an error messag
about debugging" doesn't convey any useful information to me
I couldnt find where to put the code in Current Update

Open the Form in design view; view its Properties. One of th
properties on the Events tab is the Current event. Click the ... ico
to open the VBA editor and edit the code into that event

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=publi
 
Back
Top