dlookup.visible

b4rt07

searching for an answer
Local time
Today, 18:36
Joined
Sep 6, 2007
Messages
9
Hi all,

Trying to use a dlookup to drive the visible property of the tabs in my form. I'm up to:-
DLookup("[Menu_Name]", "tMenus", "[Menu_id]=" & [Forms]![Menu]![ffMenuChoice]).Visible = True
Hope what I'm trying to achieve makes sense, if anyone can help that would be great.:confused:
 
Hi all,

Trying to use a dlookup to drive the visible property of the tabs in my form. I'm up to:-
DLookup("[Menu_Name]", "tMenus", "[Menu_id]=" & [Forms]![Menu]![ffMenuChoice]).Visible = True
Hope what I'm trying to achieve makes sense, if anyone can help that would be great.:confused:

You got it backwards. Try something like this:
Code:
me.text1.value = DLookup("[Menu_Name]", "tMenus", "[Menu_id]=" & [Forms]![Menu]![ffMenuChoice])
 
Cheers, is that saying, my field's value = result of dlookup.
My resolved objective would be e.g.
item (derived from dlookup) on form's visible property, amend to true
Is that what this would deliver?

Cheers.
 
The result of the dlookup you provided should give you the name of the menu. e.g. "Main".
If you want a control to be visible you could try this:
Code:
dim strResult as string

strResult = Dlookup("[Menu_Name]", "tMenus", "[Menu_id]=" & [Forms]![Menu]![ffMenuChoice])
if strresult = "Main" then
    me.txtMain.visible = True
else
    me.txtMain.visible = False
endif
or shorter if you leave out the if then else:
Code:
me.txtMain.visible = strresult = "Main"

enjoy!
 

Users who are viewing this thread

Back
Top Bottom