Fields in form conditinional visible / invisible or hide

PajaNegor

New member
Local time
Today, 07:38
Joined
Dec 14, 2011
Messages
4
Hello Access friends

I have a question about conditional formating of fields.
I have a form with 18 fields which must be visible or invisible depending on the value of a combobox "code"

Lets say
record 1 code A1-3 Visible 1,2,3,4,5,6 hide the rest
record 2 code A1-1 visible 1,2,8,9 hide the rest
recode 3 code A2-10 visible 5,6,7,8,9 hide the rest


sample is enclosed.

thank you in advance.

PajaNegor
 

Attachments

This is a continuous form right? It's not possible in code and trying to mimic this behaviour using Conditional Formatting will be tedious and slow.
 
...will be very tedious and slow...and in the end still won't look right! And to be honest, with eighteen Fields, this probably really should be a Single View Form.

Linq ;0)>
 
This is a continuous form right? It's not possible in code and trying to mimic this behaviour using Conditional Formatting will be tedious and slow.

Isn't it possible to do this via a case statement?
PajaNegor
 
A SELECT CASE statement is code right? I mentioned in my last post that it can't be done in code.
 
This is a continuous form right?
It would help greatly if you answered vbaInet's question. Is this a Single, Continuous or Datasheet View Form? This kind of thing can only be done, using code, if it is a SingleView Form.

Linq ;0)>
 
It would help greatly if you answered vbaInet's question. Is this a Single, Continuous or Datasheet View Form? This kind of thing can only be done, using code, if it is a SingleView Form.

Linq ;0)>

I would like to do this is in a continuous form but when it is not possible, please help me with a single form.

PajaNegor
 
If it's a Single Form you can use a Case Statement.

And I don't understand your logic:

record 1 code A1-3 Visible 1,2,3,4,5,6 hide the rest
record 2 code A1-1 visible 1,2,8,9 hide the rest
recode 3 code A2-10 visible 5,6,7,8,9 hide the rest

Code:
Select Case Nz(Me.Code, vbNullString)
    Case "A1-3"
        ... hide/unhide code here ...
    Case "A1-1"
        ... hide/unhide code here ...
    Case "A2-A10"
        ... hide/unhide code here ...
End Select
The code should go in the After Update event of the control bound to the Code field and in the Current event of the form.
 
If it's a Single Form you can use a Case Statement.

And I don't understand your logic:

record 1 code A1-3 Visible 1,2,3,4,5,6 hide the rest
record 2 code A1-1 visible 1,2,8,9 hide the rest
recode 3 code A2-10 visible 5,6,7,8,9 hide the rest

Code:
Select Case Nz(Me.Code, vbNullString)
    Case "A1-3"
        ... hide/unhide code here ...
    Case "A1-1"
        ... hide/unhide code here ...
    Case "A2-A10"
        ... hide/unhide code here ...
End Select
The code should go in the After Update event of the control bound to the Code field and in the Current event of the form.

Thanks for the reply
But I am not so familiar with VBA
Can you explain me "... hide/unhide code here ..."

PajaNegor
 
You set the Visible property of the control on that line. Look into that.
 

Users who are viewing this thread

Back
Top Bottom