Re: ADP Help
- From: "Randel Bjorkquist" <rbjorkquist@xxxxxxxxxxxxx>
- Date: Thu, 17 Nov 2005 08:33:00 -0600
Hello Sylvain,
Thanks for the information; I'll give it a try. However, I'm still a little
bit confused here. Just to help clarify something here, I think I may need
to give you a bit more information. The form I've been talking about has no
data source assigned to it. The form is only used to create a simple
employee selection form, selecting a single employee from the combo box,
"cbo_Employee". I was using the check box "chk_Terminated" and combo box
"cbo_Shifts" to filter down the number of employee names that were
displayed/listed.
Back to you suggestion. When I've try referencing a control on a from, like
"Forms!frm_EmployeeSelector!chk_Terminated", I get an error saying something
like the SQL statement can not understand/contain the "!" and that I should
set the parameter values another way. But my question is this, if all the
SQL statements are on the SQL Server, how would the SQL statement know how
to resolve the form referencing? How would it know what
"Forms!frm_EmployeeSelector!chk_Terminated" is? Does that make sense?
I'm looking forward to your reply,
Randel
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:%23T3vcss6FHA.2608@xxxxxxxxxxxxxxxxxxxxxxx
> If you are using parameterized queries for your reports, add the following
> to the input parameters property:
>
> @chk_Terminated datetime = Forms!frm_EmployeeSelector!chk_Terminated,
> @cbo_Shifts datetime = Forms!frm_EmployeeSelector!cbo_Shifts
>
> Replace the comma "," with whatever is good if you have set up the list
> separator to something else in the regional settings of your computer
> (this is often the semi-comma).
>
> You can also set up a Server Filter but I don't use them personally;
> however, it might be a good solution in your case.
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
>
> "Randel Bjorkquist" <rbjorkquist@xxxxxxxxxxxxx> wrote in message
> news:%23VqLzIs6FHA.2176@xxxxxxxxxxxxxxxxxxxxxxx
>> Hey Joe,
>>
>> Thanks for the help. You put me onto the right path. I'm actually ended
>> up putting the code in the OnEnter event of the Combo Box. I am now just
>> starting to run into more issues with how my old queries were build to
>> how they are now on the SQL Server.
>>
>> An example of what I mean is this. I have a parameter query that uses a
>> Start and Stop date from the main form. I use that query as a base query
>> for almost all of my reports. Access, if the query was written correct
>> as shown below in the "WHERE" clause, would automatically fill in the
>> parameters, but now I'll have to figure out a better/different way of
>> doing this. If you have any ideas, I'll be more then happy to hear them.
>>
>> :
>> WHERE
>> [tbl_Employee].[Terminated] =
>> [Forms]![frm_EmployeeSelector]![chk_Terminated]
>> AND
>> [tbl_Employee].[Shift] = [Forms]![frm_EmployeeSelector]![cbo_Shifts]
>> :
>>
>> I hope you understand and again thank you for your help,
>>
>> Randel Bjorkquist
>>
>>
>> "J. M. De Moor" <someone@xxxxxxxxxxxxx> wrote in message
>> news:uOmv1Nk6FHA.1944@xxxxxxxxxxxxxxxxxxxxxxx
>>> Randel
>>>
>>> Assume the name of your employee pick list form field is cbxEmployees.
>>> Add
>>> this code to OnCurrent event handler for the form (the SQL is standard
>>> MSSQL):
>>>
>>> Dim strEmplSource As String
>>> strEmplSource = "SELECT " & _
>>> " EmployeeID, " & _
>>> " LastName + ', ' + FirstName + ' ' + MiddleInit AS
>>> Employee " & _
>>> " FROM tbl_Employee " & _
>>> " WHERE Terminated = " &
>>> [Forms]![frm_EmployeeSelector]![chk_Terminated] & _
>>> " AND Shift = " &
>>> [Forms]![frm_EmployeeSelector]![cbo_Shifts] & ";"
>>> cbxEmployees.RowSource = strEmplSource
>>>
>>> If either of these fields contain non-numeric data, simply add the
>>> apostrophes to the constant, e.g.
>>>
>>> " AND Shift = '" & [Forms]![frm_EmployeeSelector]![cbo_Shifts] &
>>> "';"
>>>
>>> HTH,
>>> Joe De Moor
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: ADP Help
- From: Sylvain Lafontaine
- Re: ADP Help
- References:
- ADP Help
- From: Randel Bjorkquist
- Re: ADP Help
- From: J. M. De Moor
- Re: ADP Help
- From: Randel Bjorkquist
- Re: ADP Help
- From: Sylvain Lafontaine
- ADP Help
- Prev by Date: Re: ADP Help
- Next by Date: Re: ADP Help
- Previous by thread: Re: ADP Help
- Next by thread: Re: ADP Help
- Index(es):
Relevant Pages
|