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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter a drop down list?



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2005, 03:35 PM
babs
external usenet poster
 
Posts: n/a
Default Filter a drop down list?

I have a form for ClientID (drop down is fine) and a drop down for job# that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table. I would
like when the client id is selected from the first drop down that the drop
down for the job# ONLY includes JOB # for that given Client ID. I also want
the taxexempt field automatically populated based on what job#,client id is
selected.

Please help ASAP

Thanks so much,
Barb
  #2  
Old June 1st, 2005, 03:43 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table. I
would
like when the client id is selected from the first drop down that the drop
down for the job# ONLY includes JOB # for that given Client ID. I also
want
the taxexempt field automatically populated based on what job#,client id
is
selected.

Please help ASAP

Thanks so much,
Barb



  #3  
Old June 1st, 2005, 09:07 PM
babs
external usenet poster
 
Posts: n/a
Default



Graham,

My code that I have put in is below. I am getting a Enter Parameter Value
when I go to click on the Job drop down list?? With the Client Ids . any
idea on why with the code below. Didn't really want to add a cust number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId = " &
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table. I
would
like when the client id is selected from the first drop down that the drop
down for the job# ONLY includes JOB # for that given Client ID. I also
want
the taxexempt field automatically populated based on what job#,client id
is
selected.

Please help ASAP

Thanks so much,
Barb




  #4  
Old June 2nd, 2005, 12:06 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't find one
of the criteria used in the query. Check on ClientId, Job, or more likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter Value
when I go to click on the Job drop down list?? With the Client Ids . any
idea on why with the code below. Didn't really want to add a cust number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId = " &
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table. I
would
like when the client id is selected from the first drop down that the
drop
down for the job# ONLY includes JOB # for that given Client ID. I also
want
the taxexempt field automatically populated based on what job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb






  #5  
Old June 2nd, 2005, 04:47 AM
babs
external usenet poster
 
Posts: n/a
Default

Graham,

Thanks for your help. I think I did what you suggested but now I am getting
a Syntax errorin the FROM clause with the code below. I would love if you
could figur out what I did wrong. Not sure wiith the spaces and quotes and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE ClientId = """
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't find one
of the criteria used in the query. Check on ClientId, Job, or more likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter Value
when I go to click on the Job drop down list?? With the Client Ids . any
idea on why with the code below. Didn't really want to add a cust number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId = " &
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table. I
would
like when the client id is selected from the first drop down that the
drop
down for the job# ONLY includes JOB # for that given Client ID. I also
want
the taxexempt field automatically populated based on what job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb






  #6  
Old June 2nd, 2005, 07:02 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

Babs,

You missed a space between tbltaxexempt and WHERE. You also added a space
between cboClientId and ORDER BY (this one doesn't matter so much).

Since you're putting it all on one line, your string should look like this
(watch out, because your newsreader will wrap the following line):
sSQL = "SELECT ClientId, Job FROM tbltaxexempt WHERE ClientId = """ &
Me.cboClientId & """ ORDER BY Job"

If you want to put it on multiple lines:
sSQL = "SELECT ClientId, Job " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...
Graham,

Thanks for your help. I think I did what you suggested but now I am
getting
a Syntax errorin the FROM clause with the code below. I would love if you
could figur out what I did wrong. Not sure wiith the spaces and quotes
and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE ClientId =
"""
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't find
one
of the criteria used in the query. Check on ClientId, Job, or more
likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter
Value
when I go to click on the Job drop down list?? With the Client Ids .
any
idea on why with the code below. Didn't really want to add a cust
number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId = "
&
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for
job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table.
I
would
like when the client id is selected from the first drop down that
the
drop
down for the job# ONLY includes JOB # for that given Client ID. I
also
want
the taxexempt field automatically populated based on what
job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb








  #7  
Old June 14th, 2005, 11:35 AM
babs
external usenet poster
 
Posts: n/a
Default

Just got back to working on this. Everything is good and working however
when the job#combo box displays after the client id is 1st selected with only
the job# for that client - it shows only those clients job#s which is good -
However, I need to have the combo box for job# show also - in this order
job,taxex#,clientid. Not sure where to put it in the code to not mess it up.

Thanks for your help,
Barb

"Graham R Seach" wrote:

Babs,

You missed a space between tbltaxexempt and WHERE. You also added a space
between cboClientId and ORDER BY (this one doesn't matter so much).

Since you're putting it all on one line, your string should look like this
(watch out, because your newsreader will wrap the following line):
sSQL = "SELECT ClientId, Job FROM tbltaxexempt WHERE ClientId = """ &
Me.cboClientId & """ ORDER BY Job"

If you want to put it on multiple lines:
sSQL = "SELECT ClientId, Job " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...
Graham,

Thanks for your help. I think I did what you suggested but now I am
getting
a Syntax errorin the FROM clause with the code below. I would love if you
could figur out what I did wrong. Not sure wiith the spaces and quotes
and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE ClientId =
"""
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't find
one
of the criteria used in the query. Check on ClientId, Job, or more
likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter
Value
when I go to click on the Job drop down list?? With the Client Ids .
any
idea on why with the code below. Didn't really want to add a cust
number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId = "
&
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for
job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt table.
I
would
like when the client id is selected from the first drop down that
the
drop
down for the job# ONLY includes JOB # for that given Client ID. I
also
want
the taxexempt field automatically populated based on what
job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb









  #8  
Old June 14th, 2005, 04:45 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

sSQL = "SELECT Job, Taxex, ClientId " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
Just got back to working on this. Everything is good and working however
when the job#combo box displays after the client id is 1st selected with
only
the job# for that client - it shows only those clients job#s which is
good -
However, I need to have the combo box for job# show also - in this order
job,taxex#,clientid. Not sure where to put it in the code to not mess it
up.

Thanks for your help,
Barb

"Graham R Seach" wrote:

Babs,

You missed a space between tbltaxexempt and WHERE. You also added a space
between cboClientId and ORDER BY (this one doesn't matter so much).

Since you're putting it all on one line, your string should look like
this
(watch out, because your newsreader will wrap the following line):
sSQL = "SELECT ClientId, Job FROM tbltaxexempt WHERE ClientId = """ &
Me.cboClientId & """ ORDER BY Job"

If you want to put it on multiple lines:
sSQL = "SELECT ClientId, Job " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...
Graham,

Thanks for your help. I think I did what you suggested but now I am
getting
a Syntax errorin the FROM clause with the code below. I would love if
you
could figur out what I did wrong. Not sure wiith the spaces and quotes
and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE ClientId
=
"""
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't
find
one
of the criteria used in the query. Check on ClientId, Job, or more
likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter
Value
when I go to click on the Job drop down list?? With the Client Ids .
any
idea on why with the code below. Didn't really want to add a cust
number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId
= "
&
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for
job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt
table.
I
would
like when the client id is selected from the first drop down that
the
drop
down for the job# ONLY includes JOB # for that given Client ID.
I
also
want
the taxexempt field automatically populated based on what
job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb











  #9  
Old June 14th, 2005, 05:03 PM
babs
external usenet poster
 
Posts: n/a
Default

Just tried it and now when I go to the job# combo box after selecting the
client id no info is showing. I see column line but nothing in them.

Here is my code

Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT Job, Taxex#, ClientId" & "FROM tbltaxexempt " & "WHERE
ClientId = """ & Me.cboClientId & """ " & "ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

Also, before I modified the code to above when I moved off the new record
and came back the job # field displays either empty or with the client id NOT
the JOB# that I selected.

Thanks again,
BARb

"Graham R Seach" wrote:

sSQL = "SELECT Job, Taxex, ClientId " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
Just got back to working on this. Everything is good and working however
when the job#combo box displays after the client id is 1st selected with
only
the job# for that client - it shows only those clients job#s which is
good -
However, I need to have the combo box for job# show also - in this order
job,taxex#,clientid. Not sure where to put it in the code to not mess it
up.

Thanks for your help,
Barb

"Graham R Seach" wrote:

Babs,

You missed a space between tbltaxexempt and WHERE. You also added a space
between cboClientId and ORDER BY (this one doesn't matter so much).

Since you're putting it all on one line, your string should look like
this
(watch out, because your newsreader will wrap the following line):
sSQL = "SELECT ClientId, Job FROM tbltaxexempt WHERE ClientId = """ &
Me.cboClientId & """ ORDER BY Job"

If you want to put it on multiple lines:
sSQL = "SELECT ClientId, Job " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...
Graham,

Thanks for your help. I think I did what you suggested but now I am
getting
a Syntax errorin the FROM clause with the code below. I would love if
you
could figur out what I did wrong. Not sure wiith the spaces and quotes
and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE ClientId
=
"""
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't
find
one
of the criteria used in the query. Check on ClientId, Job, or more
likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter Parameter
Value
when I go to click on the Job drop down list?? With the Client Ids .
any
idea on why with the code below. Didn't really want to add a cust
number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE ClientId
= "
&
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down for
job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt
table.
I
would
like when the client id is selected from the first drop down that
the
drop
down for the job# ONLY includes JOB # for that given Client ID.
I
also
want
the taxexempt field automatically populated based on what
job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb












  #10  
Old June 15th, 2005, 12:13 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

You have to pay attention to spacing in SQL! You eliminated the space after
ClientId on the first line.

Also pay attention to the underscore characters ( _ ). You eliminated all of
them!

sSQL = "SELECT Job, Taxex#, ClientId " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

In order to test a SQL statement in VBA, put a breakpoint after you assign
the SQL to the variable, then use the following syntax in the Immediate
Window to see what the variable contains:
?sSQL

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
Just tried it and now when I go to the job# combo box after selecting the
client id no info is showing. I see column line but nothing in them.

Here is my code

Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSQL = "SELECT Job, Taxex#, ClientId" & "FROM tbltaxexempt " & "WHERE
ClientId = """ & Me.cboClientId & """ " & "ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

Also, before I modified the code to above when I moved off the new record
and came back the job # field displays either empty or with the client id
NOT
the JOB# that I selected.

Thanks again,
BARb

"Graham R Seach" wrote:

sSQL = "SELECT Job, Taxex, ClientId " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
Just got back to working on this. Everything is good and working
however
when the job#combo box displays after the client id is 1st selected
with
only
the job# for that client - it shows only those clients job#s which is
good -
However, I need to have the combo box for job# show also - in this
order
job,taxex#,clientid. Not sure where to put it in the code to not mess
it
up.

Thanks for your help,
Barb

"Graham R Seach" wrote:

Babs,

You missed a space between tbltaxexempt and WHERE. You also added a
space
between cboClientId and ORDER BY (this one doesn't matter so much).

Since you're putting it all on one line, your string should look like
this
(watch out, because your newsreader will wrap the following line):
sSQL = "SELECT ClientId, Job FROM tbltaxexempt WHERE ClientId = """ &
Me.cboClientId & """ ORDER BY Job"

If you want to put it on multiple lines:
sSQL = "SELECT ClientId, Job " & _
"FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...
Graham,

Thanks for your help. I think I did what you suggested but now I am
getting
a Syntax errorin the FROM clause with the code below. I would love
if
you
could figur out what I did wrong. Not sure wiith the spaces and
quotes
and _
sign(think it's just for a continuation of a line.


Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt" & "WHERE
ClientId
=
"""
& Me.cboClientId & """ " & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub





"Graham R Seach" wrote:

Babs,

If you're getting a "Enter Parameter Value" box, then Access can't
find
one
of the criteria used in the query. Check on ClientId, Job, or more
likely,
Me.cboClientId. If ClientId is text, then this is what you need:
sSQL = "SELECT ClientId, Job" & _
" FROM tbltaxexempt " & _
"WHERE ClientId = """ & Me.cboClientId & """ " & _
"ORDER BY Job"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"babs" wrote in message
...


Graham,

My code that I have put in is below. I am getting a Enter
Parameter
Value
when I go to click on the Job drop down list?? With the Client
Ids .
any
idea on why with the code below. Didn't really want to add a
cust
number
since they pretty much just go by the CustId

thanks,
BArb
Private Sub cboClientId_AfterUpdate()
Dim sSQL As String

'This function sets the RowSource of ClientId, based on the value
selected
in ClientId
sSQL = "SELECT ClientId, Job" & " FROM tbltaxexempt WHERE
ClientId
= "
&
Me.cboClientId & " ORDER BY Job"
Me.cbojob.RowSource = sSQL
End Sub

"Graham R Seach" wrote:

This will give you an idea of how to do it:
http://www.pacificdb.com.au/MVP/Code/ComboRS.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"babs" wrote in message
...
I have a form for ClientID (drop down is fine) and a drop down
for
job#
that
show CliendID, job#, and taxexempt# - based off of a Taxeempt
table.
I
would
like when the client id is selected from the first drop down
that
the
drop
down for the job# ONLY includes JOB # for that given Client
ID.
I
also
want
the taxexempt field automatically populated based on what
job#,client
id
is
selected.

Please help ASAP

Thanks so much,
Barb














 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pull unique names for drop down list [email protected] General Discussion 3 February 1st, 2005 10:23 PM
Filter list and have copied to another location bvorz General Discussion 2 August 22nd, 2004 01:44 AM
Drop Down List / Count Function Mukiwa Worksheet Functions 2 July 7th, 2004 11:56 PM
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM


All times are GMT +1. The time now is 05:15 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.