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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@DbColumn 1

Status
Not open for further replies.

carlingac

Technical User
Jan 31, 2005
25
GB
Hi


I have a form named 'NEWCALL' which has 4 fields called usrname(which is a combo box), room, telnumber and fullname on it.

I have a view called 'users' which contains 4 columns, usrname,room,telnumber and full name. (" Basically the information stored in the view is a list of computer users at an organisation")(*this view gets its values from a form called "add_new_user")

On the NEWCALL form i would like to be able to selct the usrname from a drop down list, which will then automatically fill in the room,telnumber and fullname fields for that user.

I have this formula in the usrname field on the NEWCALL form " @DbColumn("":"";"":"";"users";1) ". This looks at the first column in the users view and gives me a list of usrnames".

So what i would like to happen is for the rest of the fileds to be automatically filled in when i select one of the users.

Can this be done?, or am i way of the mark?

Hope that makes sense, I can send my database if it doesn't.
Any help or advice would be great as this is for my HNC project.

many thanks

 
If you Use @dblookup for each field in your NEWCALL form ?


@DbLookup("":"";"":"";"the name of the view to search in (users)";The string you want to find in the first sorted column (?) (the user name)"; The field you want to bing back(room))

 
I have just tried to use the dblookup but i get this error: "field: 'field name': Entry not found in index or view's index not built "

any ideas what this means?

many thanks
 
Think i worked it out, i was using the field name which dosnt do anything, but if i use the column number it worked.

Does any one know the difference between using the field name or column number?

@DbLookup("":"";"":"";"users";user_name;full) - this didnt work.

@DbLookup("":"";"":"";"users";user_name;2) - this did work.
 
You need to put the field name in quotes, i.e.

@DbLookup("":"";"":"";"users";user_name;"full")

It also helps a lot when you have a default view defined in your database, and having a default form is not a bad idea either. Sometimes, the absence of a default form/view can explain errors or inconsistant results with @Db formulas.

Pascal.
 
Oh one more thing. When i add a new entry into the view i have to close lotus then reopen it before it appears in my field( the dbcolumn field) on my form. Is there anything i can do to make the field see the new entry in the view without having to close and reopen notes?

I do have refreash on keyword change and refresh of choices on document selected on the field.

Again thanks for all your help
 
The answer in is your friendly Designer Help db, which you really should consult regularly :

@DbLookup("":"NOCACHE";"":"";"users";user_name;"full")

Or, if you make changes often, then use RECACHE instead of NOCACHE.

Pascal.
 
Many Thanks again pascal.

It helps if you know what your looking for in the designer help db.

Thanks
 
It does, but here you only need to look up the syntaxe for @dblookup ;-).

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top