Continuous form view layout question

buratti

Registered User.
Local time
Today, 14:24
Joined
Jul 8, 2009
Messages
234
I have a form I am viewing in continuous form view and the layout is similar to what the datasheet view would be. My question is quite simple, but hard to explain. For sake of simple explanation, I will use this simple example… Lets say my form is set up to display 4 columns (fields), but the underlying table has 5 fields… I want to layout the form where column 1-3 are so called “static” , but column 4 rather have a control source of (or show) filed 4 or field 5 depending on if filed 4 is null or not. I have a few ideas, but all of them seem to display the same results. One simple try was to just place both field 4 and 5 on top of each other in design view and in the oncurrent event of the form check if field 4 is null and if so hide it and show field5 and vice versa. That technically worked, but it changed the view of all records in the form to whatever the current records view settings were. Is it even possible to have different view properties for each separate record in continuous form view (like an object hidden on record 1 while not hidden on record 2 and so on)?
 
You won't be able to update the data with the form set that way but you can display the values by using this as the control source of the text box:

=IIf(IsNull([Field4Name]) And Not IsNull([Field5Name]),[Field5Name], IIf(IsNull([Field5Name]) And Not IsNull([Field4Name]), [Field4Name], Null))
 
Ah! Simple yet effective. Thanks. And just for future reference, if I had a picture or something in the form with the same situation, where I wanted to hide it on some records and show on others, that would be impossible right? At least for a continious form view?
 
Ah! Simple yet effective. Thanks. And just for future reference, if I had a picture or something in the form with the same situation, where I wanted to hide it on some records and show on others, that would be impossible right? At least for a continious form view?

Which version of Access are you using?
 
In Access 2007 you can insert an image control and you can use a control source to display the image you want based on the value of something in that particular record. So, something like this:
=IIf([SomeField]="Something", "C:\Temp\Whatever.jpg", "E:\SomeFolder\Nothing.jpg)
 
Oh good to know. Thanks. I dont have a use for it now, but I'm sure somday soon I will come across something where I will need to do something similar
 

Users who are viewing this thread

Back
Top Bottom