Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Views

Status
Not open for further replies.

jsulman

Programmer
Jun 14, 2001
85
0
0
US
I am trying to filter a view based on the current user. I was told the only way to do this on the web is to create an embedded view.

I have a view with a column called Originator. I imbedded this view into a form where I have created a field called Logger which has as the default value the user name of the person logged in. What I am trying to do is filter the view so that the only Originators who show up are those whose name is equal to Logger. I have not idea how to do this. I have tried a number of formulas in the Embedded Selection and used the Selected Categories but I cannot get anything close to the results I need. I found a few examples in the forum but none were specific enough to help.

I found out that you can refer to the Embedded view in the form through $$ViewTemplate. However, I am still puzzled by what syntax I would use to do this.

Can anybody help with this?

Thank you in advance,

Jeff Sulman
 
In the view you created, the first column should be the username and be sorted and categorized. This column will be the user name of people.


In your form, make the 'Logger' field with the default as @Username.

Embed the view in the form and just to ensure Notes reads everything correctly, put the embedded view below the 'Logger' field. Once you select the view, there will be a selection, 'Show single category,' click on this and add the field name, 'Logger' in the right pane.

When opening the form in the database, only the entries in the view corresponding to the user opening the view will display.

Try the above steps and let me know if you have any problems.

desNotes
 
desNotes,
That worked!! Thank you very much. The only thing mistake I made was adding the text "Logger" to the Show Single Category. Instead I added @GetField("Logger") and it worked.

Thank you again!!

Jeff Sulman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top