Re: ADP Help



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
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Data Entry Form - 2 Tables
    ... First using the employee name to link the ... The trick is that you want to use the query as ... Now use strSQL as the data source for your second form. ... Another way is to use the base SQL statement (the sql statement minus ...
    (microsoft.public.access.formscoding)
  • Re: Help with query counting unique records???
    ... If you don't mind I have a question regarding your SQL statement. ... How do I create that statement using Access design view of a query. ... >>> every employee for every job. ...
    (microsoft.public.access.queries)
  • Re: Help with query counting unique records???
    ... I am not sure what you did but I would expect the Query I posted to return 1 ... Post the structure of your Table, some sample data and your attempted SQl ... > I pasted the SQL statement into the query but it still counts 1 record for ... > every employee for every job. ...
    (microsoft.public.access.queries)
  • RE: Query question
    ... It is likely that your SQL statement currently joins the Employee table to ... If you are not familiar with SQL and use the Query Design, ... > create a query that will display the total number of meeting hours for each ...
    (microsoft.public.access.queries)
  • Re: Error using " in .open with ADODB.Recordset
    ... recordset but I'm getting hung up on the SQL statement. ... query that has a string as a condition. ... Dim mrk As String ...
    (microsoft.public.data.ado)

Quantcast