selective data for combo box

  • Thread starter Thread starter Cheswyck
  • Start date Start date
C

Cheswyck

I'm collecting times for a customer/job database. In the
form, the customer and job codes are combo boxes. When
selecting the 'job' I only want to display the jobs that
relate to the customer which is the preceeding entry.
Customers and jobs have their own entry form and the job
table includes the customerID as a foreign key.
I think I want the SQL to say something like WHERE [job].
[customer] = [me].[customer] but when i get to the job
combo i get an error.
How should I handle this problem?
 
Hi Cheswyck

SQL will not understand [Me].[customer], as Me is only valid within the
form's class module. You will need to specify the form entirely:
WHERE [job].[customer] = [Forms]![My Form]![customer]

Also, you will need to requery the combo box ([ComboName].Requery) every
time the customer changes (for example, in the Form_Current event).
 
In the Row Source of the Combo Box use the query builder
to select the Job Codes and have a second field that has
the critera of [Forms]![NameofForm].[Customer]

I do the excat same thing and is works great.... Let me
know
 
Thanks for your help. I've learned a lot from both of
you. I'll be able to move on to the next hurtle. It's
been a while and I'm a little rusty.
But now I have another question...
-----Original Message-----
In the Row Source of the Combo Box use the query builder
to select the Job Codes and have a second field that has
the critera of [Forms]![NameofForm].[Customer]

I do the excat same thing and is works great.... Let me
know
-----Original Message-----
I'm collecting times for a customer/job database. In the
form, the customer and job codes are combo boxes. When
selecting the 'job' I only want to display the jobs that
relate to the customer which is the preceeding entry.
Customers and jobs have their own entry form and the job
table includes the customerID as a foreign key.
I think I want the SQL to say something like WHERE [job].
[customer] = [me].[customer] but when i get to the job
combo i get an error.
How should I handle this problem?
.
.
 
Back
Top