Please help me !

G

Guest

what should i write in the controlsource of a text box on a single form to
disply
the Shift of an agent who's equal to the Combo box "agent" in the form and
on the date that equals the form's date.
Here' the table :

Date Shift Skills Agent name
01/08/2006 9:00 TSLM John
01/08/2006 12:00 PA Tom
01/08/2006 9:00 TSLM John
01/08/2006 12:00 PA Tom
02/08/2006 9:00 TSLM Nadia
02/08/2006 9:00 TSLM Sara
02/08/2006 9:00 PA Peter
03/08/2006 10:00 PA Mario
04/08/2006 10:00 TSLM Tony
05/08/2006 16:00 TSLM Mario
 
G

Guest

Hi

You could filter the form Date()

Or

Add an extra column to your combo to show the ID field of .... ie.

[IDfield] [Date] [Shift] [Skilss] [AgentName]
to give you
1234 01/08/2006 9:00 TSLM John

Set the bound column to 1
Column Count = 5
0cm;2cm;0cm;0cm;2cm
(to just show the date and the agent)

The control source of your combo will be
=ComboName.column(2)

Note that the column counts start from 0 so the 3rd column is 2

Hope this helps
 
G

Guest

Thank you very much for you prompt reply
It seems that i was not clear
I cannot creat a new column ,just i want to correct the following
controlsource of the "shift" unbound box on the single form ,as it is not
correct :
=Dlookup("Shift","Schedule", "[Agent] = [Forms].[Form name]![Agent]And
[Date] = #" & txtDate & "#")
That's to say : display the value "shift" in the "Schedule" table
Where"Agent" field in the table equals "Agent" field on the current form and
"Scedule date" field in the table equals "Scedule date" field on the
currentform,by the way the form is "single form".
Best Regards


Wayne-I-M said:
Hi

You could filter the form Date()

Or

Add an extra column to your combo to show the ID field of .... ie.

[IDfield] [Date] [Shift] [Skilss] [AgentName]
to give you
1234 01/08/2006 9:00 TSLM John

Set the bound column to 1
Column Count = 5
0cm;2cm;0cm;0cm;2cm
(to just show the date and the agent)

The control source of your combo will be
=ComboName.column(2)

Note that the column counts start from 0 so the 3rd column is 2

Hope this helps

--
Wayne
Manchester, England.
Not an expert.
Enjoy whatever it is you do.



Pietro said:
what should i write in the controlsource of a text box on a single form to
disply
the Shift of an agent who's equal to the Combo box "agent" in the form and
on the date that equals the form's date.
Here' the table :

Date Shift Skills Agent name
01/08/2006 9:00 TSLM John
01/08/2006 12:00 PA Tom
01/08/2006 9:00 TSLM John
01/08/2006 12:00 PA Tom
02/08/2006 9:00 TSLM Nadia
02/08/2006 9:00 TSLM Sara
02/08/2006 9:00 PA Peter
03/08/2006 10:00 PA Mario
04/08/2006 10:00 TSLM Tony
05/08/2006 16:00 TSLM Mario
 
J

John Vinson

Thank you very much for you prompt reply
It seems that i was not clear
I cannot creat a new column ,just i want to correct the following
controlsource of the "shift" unbound box on the single form ,as it is not
correct :
=Dlookup("Shift","Schedule", "[Agent] = [Forms].[Form name]![Agent]And
[Date] = #" & txtDate & "#")

The third argument should be a text string that evaluates to a valid
SQL WHERE clause. If Agent is a text field, it needs to be delimited
by either ' or " - if it's a person's name, use " because some names
contain apostrophes: you can insert a " in a text string delimited by
" by using two consecutive " characters.

=Dlookup("Shift","Schedule", "[Agent] = """ & [Forms].[Form
name]![Agent] & """ And [Date] = #" & [Forms]![Form Name].[txtDate] &
"#")

This assumes that your form is named Form Name - I presume it has some
more reasonable name, if so replace [Form Name] with the actual name
of your form.

John W. Vinson[MVP]
 

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

Similar Threads


Top