473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to have query execute when a dependent field is updated

I have the query below (as a row source)update a list box with all the
employees of a supervisor. The problem is it doesn't automatically
update when a the referened field on the form (supervisor) is
updated. It works only when I choose a value, close the form and re-
enter the form.

Thanks in advance.

SELECT DISTINCT [Personnel]![LName] & ", " & [Personnel]![FName] AS
Expr1, [Personnel]![Supervisor LName] & ", " & [Personnel]![Supervisor
FName] AS Expr2 FROM Personnel WHERE ((([Personnel]![Supervisor LName]
& ", " & [Personnel]![Supervisor FName])=[Forms]!
[frmRequired_Single_Training]![Supervisor_Dropdown]));

Jun 14 '07 #1
2 1388
On the After_Update event of the Supervisor field, Requery the list box having
the query as its Rowsource.

Good luck.

<sa*******@yahoo.comwrote in message
news:11**********************@z28g2000prd.googlegr oups.com...
>I have the query below (as a row source)update a list box with all the
employees of a supervisor. The problem is it doesn't automatically
update when a the referened field on the form (supervisor) is
updated. It works only when I choose a value, close the form and re-
enter the form.

Thanks in advance.

SELECT DISTINCT [Personnel]![LName] & ", " & [Personnel]![FName] AS
Expr1, [Personnel]![Supervisor LName] & ", " & [Personnel]![Supervisor
FName] AS Expr2 FROM Personnel WHERE ((([Personnel]![Supervisor LName]
& ", " & [Personnel]![Supervisor FName])=[Forms]!
[frmRequired_Single_Training]![Supervisor_Dropdown]));

Jun 14 '07 #2
The command below worked. Being a complete vb novice I wasn't sure
how the requery command should be set up.

This didn't work: Me.EmployeList.Requery

This did work: Me.Refresh( in the form fields After Update event...)
by Bjarne
On Jun 14, 1:57 pm, "Gary Floam" <f...@comcast.netwrote:
On the After_Update event of the Supervisor field, Requery the list box having
the query as its Rowsource.

Good luck.

<sandpk...@yahoo.comwrote in message

news:11**********************@z28g2000prd.googlegr oups.com...
I have the query below (as a row source)update a list box with all the
employees of a supervisor. The problem is it doesn't automatically
update when a the referened field on the form (supervisor) is
updated. It works only when I choose a value, close the form and re-
enter the form.
Thanks in advance.
SELECT DISTINCT [Personnel]![LName] & ", " & [Personnel]![FName] AS
Expr1, [Personnel]![Supervisor LName] & ", " & [Personnel]![Supervisor
FName] AS Expr2 FROM Personnel WHERE ((([Personnel]![Supervisor LName]
& ", " & [Personnel]![Supervisor FName])=[Forms]!
[frmRequired_Single_Training]![Supervisor_Dropdown]));- Hide quoted text -

- Show quoted text -
This

Jun 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: 'bonehead | last post by:
Greetings, I'd like to figure out some syntax for retrieving the data from a table when I don't know all the of field names. What I do know are, the name of the table, the names of the primary...
2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
2
by: Jerome | last post by:
Hi, I've got the following problem and I don't know how to make this (if it's possible at all): I want to make a form where the user can enter a criteria and then, after pushing a button or...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
6
by: Nicolae Fieraru | last post by:
Hi All, I was trying to update a field in a table, based on the results from a query. The table to be updated is tblCustomers and the query is qrySelect. This query has two parameters, provided...
4
by: deko | last post by:
I'm a little nervous about slamming my database with a dozen Update queries in a loop that all modify RecordSources of open forms. Will the use of DoEvents and/or a Sleep function ameliorate any...
3
by: ah077 | last post by:
I am trying to run a SQL query as follows: SELECT INVMST.INUMBR, INVMST.IDESCR, CASE WHEN SUM(INVCHS.CHQT01) = 0 THEN SUM(INVCHS1.CHQT01) ELSE SUM(INVCHS.CHQT01) END as QTY1, CASE WHEN...
6
JKing
by: JKing | last post by:
I'm using an update query to update a single field in a table. Table1 is part of my normalized table structure. Table2 is used solely as an import table for raw data which I sort and summarize...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.