SQL JScript??

D

dixieee

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
 
A

Adam Harding

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
 
D

dixieee

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
 
A

Adam Harding

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
 
D

dixieee

yes Adam I'm so thankful it worked great and my supervisor is a
superhappyvisor now :D thanx a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top