Search for a kind of DLookup-Field... (1 Viewer)

AHeyne

Registered User.
Local time
Today, 07:04
Joined
Jan 27, 2006
Messages
96
Hi folks,

an every few months recurring question I have is, that I would need a kind of DropDown-Box without a dropdown. :)
Or lets call it a DLookup-field.

Reason:
In a table-field there is a value stored (a '1' for example).
In the form now, I want to display the regarding text, which should be taken from a detail-table ('Number one' for example).

I have different possibilities doing this:
1. A calculated formfield (using a DLoopup or any other way to get the text): Nice, but the annoying disadvantage is, that it is calculated lets say a second delayed, after changing the current dataset.

2. A DropDown-control (ComboBox). This is displayed without any delay, but it looks like a ComboBox. But I don't want the user getting the idea to 'open' it. So this would be perfect, if it would just look like a textbox or a label.

3. A Listbox. Arguments are the same as in point 2.

4. The forms recordsource could join the stuff together, but this could be a horrible huge query, if you have several such fields. Additionally you could get problems with having a no more editable recordsource.

Question:
What I want is a control, looking like a TextBox (or maybe like a label), which operates like a ComboBox (getting values from detailtables immediately).

I know Access since V2.0, now using 2007.
But this annoying problem is recurring all the time.
Is there a solution anywhere?
Maybe I'm just too blind?

Regards,
AtzeX
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 15:04
Joined
Jan 20, 2009
Messages
12,866
Disable and Lock a combo so it doesn't work.

Place a rectangle with a backcolor the same as the form over the combo drop down arrow. I often do this when a form is displaying a record that should not be edited and then set the rectangle to not Visible when allowing edits.
 

AHeyne

Registered User.
Local time
Today, 07:04
Joined
Jan 27, 2006
Messages
96
Thanks for reply.
Yes, this could be a solution.
But for sure much work, if there are multiple of such fields...

So this would mean, that there is (still) no other way...

What a pity. :(
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 15:04
Joined
Jan 20, 2009
Messages
12,866
Thanks for reply.
Yes, this could be a solution.
But for sure much work, if there are multiple of such fields...

So this would mean, that there is (still) no other way...

What a pity. :(

Make one rectangle, copy and paste. Hardly a huge effort.

Another way is to make the combo not visible and set the control source of a textbox to the appropriate column.

= Forms!formname!comboname.Column(x)

No, forget it, obviously too much work. :rolleyes:
 

AHeyne

Registered User.
Local time
Today, 07:04
Joined
Jan 27, 2006
Messages
96
Kind of english humour? :D

Ok, the second solution sounds quite nice. Will give it a try.

Thanks!
 

AHeyne

Registered User.
Local time
Today, 07:04
Joined
Jan 27, 2006
Messages
96
Ok, this last idea works quite well.

But now, during my tries, I found a cool possibility to speedup the refresh of calculated fields:
Code:
Private Sub Form_Current()
    Me.Recalc
End Sub

The calculated form-fields appear simultaneously now with all others.
So this seems to be the 'master-way'!

Any known backdraws in this technic?
 

Users who are viewing this thread

Top Bottom