Read-only values on continuous subform best pratices

razovsuki

Registered User.
Local time
Today, 22:52
Joined
Feb 17, 2015
Messages
17
Hi everyone,

I finally managed to find how to display things how I would like them but I was wondering what you think the best practices for that are, and if I'm not overdoing it.

Basically, I would like to have on my continuous subform fields from my table but only as a non-editable list (I have a dedicated mod form to actually modify the values), and I don't really like the way "Locked" and/or "Enabled" work, especially on combo boxes. To me, the arrow shouldn't be there: it looks like you can modify it, but you can't; it's a bit confusing and counter intuitive.

So what I did is replace those combo boxes with text boxes, and used DLookUp in the Control Source. Now I can lock and disable the text boxes and it looks just as I want it: you can't select the text, and most importantly there's no dropdown arrow.
It works, but it's kind of a lot of work compared to what it is with the cbo. Also, since those are calculated values, they take a fraction of a second to appear, as opposed to the nearly instantaneous display of the values with the cbo, and there's only 5 entries in my test database...

So I was wondering if that solution has been used by someone, if it is viable or if there's a better one, or if I should really stick to the locked combo boxes.

What do you think?
Many thanks in advance for your input!
 
Sounds like the displayed values come from a related table. You can base the form on a query that joins the tables together, enabling you to return the text value as a field.
 
I go with Pauls suggestion re the comboboxes, but rather than locking/disabling controls, set the form properties - allow edits to be false
 
@pbaldy
Thanks! I'm still fairly new to Access, and didn't think a JOIN query would help me with that. It does!
Now, I'm still having an issue with that though:
Two of the fields in the main table I'm querying use the same kind of information (language), so they take their data from the same related table (t_Languages).
So, in my t_ProjectTasks table, I have a SourceLanguage and a TargetLanguage fields. This doesn't seem to agree with the query I'm trying to create: whenever I try to add those two information to it, the query returns no result (which makes sense).
Do I have to separate the t_Languages table into two tables for this to work?
Does that make sense database-wise?

I noticed that, when I open the Relationships window, Access displays the table as two: "t_Languages_1" and "t_Languages_2".

@CJ_London
Allow Edits to false doesn't hide the arrow on combo boxes, does it though?
 
Allow Edits to false doesn't hide the arrow on combo boxes, does it though?
I didn't say it would - I said

rather than locking/disabling controls....

Another suggestion is to set your form recordset type to snapshop rather than locking/disabling controls
 
Never mind, I found the solution to my problem.
Basically, in the query designer, if you add a table multiple times using the "Show table" window, it gets added multiple times as well, with "_X" appended to the name each time (X being a number). You can then manually link the related fields together, and it all works like a charm!

@CJ_London
Ah ok, sorry. I could use Allow Edits (no), yes. But I need some of the fields to be editable though, so I'll lock the controls I want locked one by one instead.
 
Glad you found the solution. That's what I would have suggested.
 
1st post
I would like to have on my continuous subform fields from my table but only as a non-editable list
last post
But I need some of the fields to be editable though
Nice to be consistent:D
 
Nice to be consistent

Fair enough :)
I just think I'm already pretty wordy as it is, so I guess I chose to skip some of the details!
 

Users who are viewing this thread

Back
Top Bottom