set different visibility of controls in each record (1 Viewer)

LjushaMisha

Registered User.
Local time
Today, 17:48
Joined
Mar 10, 2017
Messages
55
Hello to All.

I've made ACCESS CONTINUOUS form like the one in attachment (which is actually Excel shape)

Main wish is to have VALUES in controls Range_m;Area_m2; Volume_m3; and their VISIBILITY depending on Measure unit value ("m", "m2", "m3")

On AfterUpdate event of MeasureUnit I've made some code about problem
If Me.MeasureUnit = "m" then
Me.Area_m2.visible = False
Me.Area_m2.Value = 0
Me.Volume_m3.visible = False
Me.Volume_m3.Value= 0
Me.Range_m.visible = True
Me.Range_m.Value = 2 * x + 2 * y

...
...
...
End if


BUT, BUT, BUT:banghead::banghead::banghead:ecord settings by code change also apperance of controls in previous record.

Any HELP, Please.
 

Attachments

  • LikeForm.xlsx
    10.5 KB · Views: 44

theDBguy

I’m here to help
Staff member
Local time
Today, 09:48
Joined
Oct 29, 2018
Messages
21,358
Hi. That's right. A continuous form, although showing multiple rows, really only have one control you can refer to by code. So, modifying any of them will modify all the rows as well. The only way to change the appearance of individual row controls is through Conditional Formatting (CF). However, CF is limited on what you can do with it. For example, you can disable a control but not hide it.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:48
Joined
Aug 30, 2003
Messages
36,118
You can kinda-sorta hide a control with CF by setting the font color to match the background color. Might take some finagling.
 

LjushaMisha

Registered User.
Local time
Today, 17:48
Joined
Mar 10, 2017
Messages
55
I've found out solution, which I don't like much but I think it will work
In main form (which will be Single & Unbound Form) I can do "all" I want. At the end of row I'll put command button Like "insert new record". This record will be than "transported" via VBA to subform, which's recordsource will be temporary table for ONE
product (i.e. all records in subform)
Why I don't like this solution??
As I want my calculated fields to be seen in subform I'll be forced to save them in bounded table.

What is your oppinion??
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:48
Joined
Jul 9, 2003
Messages
16,244
I'll be forced to save them in bounded table.

Why do you want to use unbound forms? It's one of the most advantageous features of MS Access in that you do not have to mess around linking the forms to your tables?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:48
Joined
Feb 19, 2002
Messages
42,971
I don't like your solution either but not for your reasons. I don't like it for the same reason as Uncle Gizmo.

You do not have to save the calculated values. You only have to modify the RecordSource query of the subform to include the calculations. Then they can be bound to the form without being actually saved to the underlying table
 

LjushaMisha

Registered User.
Local time
Today, 17:48
Joined
Mar 10, 2017
Messages
55
Yes. A,ready done what you suggested. It is not ideal, but I get what I want.
Will mark thread as SOLVED
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:48
Joined
Oct 29, 2018
Messages
21,358
Yes. A,ready done what you suggested. It is not ideal, but I get what I want.
Will mark thread as SOLVED
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom