A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Autolookup Query



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 10:06 PM
Ernie
external usenet poster
 
Posts: n/a
Default Autolookup Query

I have an autolookup query that automatically fills in employee name and rate on a form. What I would like is to be able to update the rate, for each record, without updating all of the data in the query to the new value entered, ie if I change the rate on the form, the new rate value is used in all existing records for the calculation. Has me stumped and would appreciate any suggestions.
  #2  
Old May 26th, 2004, 01:14 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default Autolookup Query

Ernie

Is the rate field bound to an underlying table field? What is the
code/expression you are using to do the calculation you mention? What is
the code you are using to update the "employee name" and "rate" controls on
your form? You and I may not have the same definition of "autolookup
query" -- what's your definition?

--
More info, please ...

Jeff Boyce
Access MVP

  #3  
Old May 26th, 2004, 06:06 PM
Ernie
external usenet poster
 
Posts: n/a
Default Autolookup Query

I have two linked tables, Employee with fields for Employee ID, Base rate, and name(the "one" side), and Timecard Distribution (the "many" side)with fields for Employee ID, Rate ,Name, Hours and Account. The query design includes the following fields from Employee ID table: Base rate, and name, and from the Timecard distribtuion table the fields: Employee ID , Rate, Name , Account, Hours, and a calculated field named Total which equals Rate from Timecard Distribution * Hours. On the form based on the query, when Employee ID is entered, the Base rate and Name is automatically entered with values from the Employee table. While I don't want to change the value of Base rate in Employee table, I would like the option of putting in a different rate in a record and have the calculation for Total to reflect that rate for that record.
  #4  
Old May 26th, 2004, 08:46 PM
Ernie
external usenet poster
 
Posts: n/a
Default Autolookup Query



----- Jeff Boyce wrote: -----

Ernie

Is the rate field bound to an underlying table field? What is the
code/expression you are using to do the calculation you mention? What is
the code you are using to update the "employee name" and "rate" controls on
your form? You and I may not have the same definition of "autolookup
query" -- what's your definition?

--
More info, please ...

Jeff Boyce
Access MVP
I have two linked tables, Employee with fields for Employee ID, Base rate, and name(the "one" side), and Timecard Distribution (the "many" side)with fields for Employee ID, Rate ,Name, Hours and Account. The query design includes the following fields from Employee ID table: Base rate, and name, and from the Timecard distribtuion table the fields: Employee ID , Rate, Name , Account, Hours, and a calculated field named Total which equals Rate from Timecard Distribution * Hours. On the form based on the query, when Employee ID is entered, the Base rate and Name is automatically entered with values from the Employee table. While I don't want to change the value of Base rate in Employee table, I would like the option of putting in a different rate in a record and have the calculation for Total to reflect that rate for that record.


  #5  
Old May 28th, 2004, 01:27 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default Autolookup Query

Ernie

I'm still somewhat baffled. You say

While I don't want to change the value of Base rate in Employee table, I

would like the option of putting in a different rate in a record and have
the calculation for Total to reflect that rate for that record.

If you don't want to record a changed BaseRate, what "record" are you
talking about putting a different rate into? It would still be helpful if
you'd post the SQL statement your query uses.

--
More info, please ...

Jeff Boyce
Access MVP

  #6  
Old May 28th, 2004, 07:16 PM
Ernie
external usenet poster
 
Posts: n/a
Default Autolookup Query

Jeff, this is the SQL statement the query currently uses:
SELECT [Timecard Distribution].Date, [Timecard Distribution].EmployeeNumber, Employees.LastName, Employees.FirstName, Employees.Rate, [Timecard Distribution].Rate, [Timecard Distribution].[Account Number], [Timecard Distribution].Hours, ([Timecard Distribution]![Rate])*([Timecard Distribution]![Hours]) AS TOTAL
FROM Employees INNER JOIN [Timecard Distribution] ON Employees.EmployeeNumber = [Timecard Distribution].EmployeeNumber
WHERE ((([Timecard Distribution].Date)0));

  #7  
Old May 30th, 2004, 05:25 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default Autolookup Query

Ernie

Thanks for posting the SQL statement. I still don't think I understand
enough about where you are trying to change the Rate, and where you are
trying to store the rate. Could you also provide this information, and a
brief description of the table structure that would apply?

Thanks

Jeff Boyce
Access MVP

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.