Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2006

Tip: Looking for answers? Try searching our database.

SQL JScript??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dixieee - 18 Apr 2006 09:31 GMT
I need help with this plz..

I have an Employees table where it stores info about employees (users) and
their usernames. when they open a form, their username will appear and lookup
their info from that table according to it. i do get the username by JScript
but i\m having a hard time getting the info from that username. what query
should I use?

Thanx
Adam Harding - 18 Apr 2006 13:02 GMT
dixieee

no query just set the fields you want to populate equal to the field from
your secndary datasource and then click the filter button and specify where
username in the secondary datasource = USERNAME DISPLAYED IN THE FORM FIELD.

Ie USERNAME field is populated on opening the form the field is called
EmailAddress its default value is displayed from a secondary data source
called UserDetailsSecondary column name EmailAddressSecondary.

It would have a filter on it saying Where UsernameSecondary is equal to
USERNAME.

Do this for all the other fields and it is all sorted.  This is provided the
secondary data source contains the information you need.  If not you need to
find it first.

I hope this helps

Cheers Adam

> I need help with this plz..
>
[quoted text clipped - 5 lines]
>
> Thanx
dixieee - 18 Apr 2006 13:24 GMT
Adam thanx a lot for redirecting me..

ok I followed ur instructions but i'm still getting all the users from the
table :s
i don't know what's wrong this is what i did:

the fields that get username and domain onLoad are:
Field3 (for username)
Field2 (for domain)

then i have a section (not a repeating table but i don't think the problem
is here cz i tried all the options) that has secondary data from table
Employees. This section/table includes:
Employee ID (which is only a serial number set as primary key)
FirstName
LastName
Position
StartingDate
TakenDays (for the vacation requests)
Username (which "is supposed to" store all usernames to return all the
preceding info)

in each field, i'm setting the rules as Username=field3
and in actions i chose "query action using a data connection" and when it
didn't work i removed that action and set it to "stop processing when this
rule finishes.."

where am i doing the mistake?

thanx a lot again
Adam Harding - 18 Apr 2006 15:34 GMT
dixieee

Say you want to populate the firstname of someone's username from this
separate table.

You would have to do the following;

Double click the control you want the name to appear in and in the default
value section of the properties box click the fx button on the far Right hand
side.  Now select to insert a field or group.  Browse to your Employees table
and select the Firstname field.  In the bottom left hand corner of the little
window select 'Filter Data'

Now the improtant bit you have to specify WHERE USERNAME in the Employees
Table is equal to USERNAME on the form.  To select the Username in the
employees table click the drop-down arrow in the first box and select to add
a field of group (notice at the top it tells you it is in the employees
table) and select Username.  In the second box click the arrow and at the top
of the little window change the data source back to the form data source and
browse to the Username field on the form.

OK out of there and that will work for firstname, repeat the steps for the
other controls and they will all autofill.

You do not need to 'query action using a data connection' at all.

I hope this is clearer

Cheers Adam

> Adam thanx a lot for redirecting me..
>
[quoted text clipped - 26 lines]
>
> thanx a lot again
dixieee - 19 Apr 2006 06:44 GMT
yes Adam I'm so thankful it worked great and my supervisor is a
superhappyvisor now :D thanx a lot
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.