filter

G

Guest

Private Sub Combo87_AfterUpdate()
Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
Me.FilterOn = True
End Sub
This is what I have in a combo box 87, I used to have this as a text but
had to change it to a date. now it does not work. The error message I get
is Run time error 200
You canceled the previous operation. I have not changed any of the coding
at all just turned a text into a date field. Now what?

Thanks
Chey
 
G

Guest

it doesn't do any thing. When I choose the month it is suppose to filter
everything in the form with that month.

default105 said:
Try
Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

Chey said:
Private Sub Combo87_AfterUpdate()
Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
Me.FilterOn = True
End Sub
This is what I have in a combo box 87, I used to have this as a text but
had to change it to a date. now it does not work. The error message I get
is Run time error 200
You canceled the previous operation. I have not changed any of the coding
at all just turned a text into a date field. Now what?

Thanks
Chey
 
G

Guest

So are you saying that you have text format in one and a date format in
another?


Chey said:
it doesn't do any thing. When I choose the month it is suppose to filter
everything in the form with that month.

default105 said:
Try
Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

Chey said:
Private Sub Combo87_AfterUpdate()
Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
Me.FilterOn = True
End Sub
This is what I have in a combo box 87, I used to have this as a text but
had to change it to a date. now it does not work. The error message I get
is Run time error 200
You canceled the previous operation. I have not changed any of the coding
at all just turned a text into a date field. Now what?

Thanks
Chey
 
G

Guest

no I changed everything over to date. However in the combo box, i have it
pulling from a table, and then i have unique value selected. So then on my
form I have the combo box and then the field it is suppose to filter with.
Everything is out of the same table. and also the same field. Everything
matches. When I select the month it just blinks and stays the same. After I
choose my month i then choose a provider number. The provider number works
okay, just not the month.
Under where I choose the vendor number I have

Private Sub cboMoveto_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
Me![CboMoveTo] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


End Sub

Thanks for your time.

default105 said:
So are you saying that you have text format in one and a date format in
another?


Chey said:
it doesn't do any thing. When I choose the month it is suppose to filter
everything in the form with that month.

default105 said:
Try
Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

:

Private Sub Combo87_AfterUpdate()
Me.Filter = "[tblGrantCompletion.theMonth] = '" & Me.Combo87 & "'"
Me.FilterOn = True
End Sub
This is what I have in a combo box 87, I used to have this as a text but
had to change it to a date. now it does not work. The error message I get
is Run time error 200
You canceled the previous operation. I have not changed any of the coding
at all just turned a text into a date field. Now what?

Thanks
Chey
 
G

Guest

Ok, bear with me hear, I had a similar problem with a combobox when applying
a filter before. What I found is that when you create a combobox the wizard
asks to hide the key column. In the SQL statement the keyID field is first
but the bound column is 1 but the value I was pulling is actually the keyID.
I had to change my row source so the keyID was after the display value and
then change the column widths to ie 1";0" so the keyID is hide again.

Does this help?

Chey said:
no I changed everything over to date. However in the combo box, i have it
pulling from a table, and then i have unique value selected. So then on my
form I have the combo box and then the field it is suppose to filter with.
Everything is out of the same table. and also the same field. Everything
matches. When I select the month it just blinks and stays the same. After I
choose my month i then choose a provider number. The provider number works
okay, just not the month.
Under where I choose the vendor number I have

Private Sub cboMoveto_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
Me![CboMoveTo] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


End Sub

Thanks for your time.

default105 said:
So are you saying that you have text format in one and a date format in
another?


Chey said:
it doesn't do any thing. When I choose the month it is suppose to filter
everything in the form with that month.

:

Try
Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

"Chey" wrote:
 
G

Guest

okay that didn't make any sense. Why would this have worked before with a
text but does not work with a date? I didn't use the wizard with the combo
box. I also have the combo box in the form header, along with the vendor
number combo box.

default105 said:
Ok, bear with me hear, I had a similar problem with a combobox when applying
a filter before. What I found is that when you create a combobox the wizard
asks to hide the key column. In the SQL statement the keyID field is first
but the bound column is 1 but the value I was pulling is actually the keyID.
I had to change my row source so the keyID was after the display value and
then change the column widths to ie 1";0" so the keyID is hide again.

Does this help?

Chey said:
no I changed everything over to date. However in the combo box, i have it
pulling from a table, and then i have unique value selected. So then on my
form I have the combo box and then the field it is suppose to filter with.
Everything is out of the same table. and also the same field. Everything
matches. When I select the month it just blinks and stays the same. After I
choose my month i then choose a provider number. The provider number works
okay, just not the month.
Under where I choose the vendor number I have

Private Sub cboMoveto_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[tblChild Care Providers_Vendor Number] = '" &
Me![CboMoveTo] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


End Sub

Thanks for your time.

default105 said:
So are you saying that you have text format in one and a date format in
another?


:

it doesn't do any thing. When I choose the month it is suppose to filter
everything in the form with that month.

:

Try
Me.Filter = "[tblGrantCompletion.theMonth] = '" & [Combo87] & "'"

"Chey" wrote:
 
G

Guest

First off, what I posted does make sense if you used a wizard but as I see
this is not your situations. I say that it is a formatting issue because as
you said it was text before and now it is date. Probably is trying to
compare two different formats. I will turn this over to someone else. I
thought it might have only been a error with the combo box reference. The
only other thing I can possibly think as a try is to use

"[tblGrantCompletion.theMonth] = " & [Combo87]
 
G

Guest

First off, what I posted does make sense if you used a wizard but as I see
this is not your situations. I say that it is a formatting issue because as
you said it was text before and now it is date. Probably is trying to
compare two different formats. I will turn this over to someone else. I
thought it might have only been a error with the combo box reference. The
only other thing I can possibly think as a try is to use

"[tblGrantCompletion.theMonth] = " & [Combo87]
 
G

Guest

Thanks, that will be great.

default105 said:
First off, what I posted does make sense if you used a wizard but as I see
this is not your situations. I say that it is a formatting issue because as
you said it was text before and now it is date. Probably is trying to
compare two different formats. I will turn this over to someone else. I
thought it might have only been a error with the combo box reference. The
only other thing I can possibly think as a try is to use

"[tblGrantCompletion.theMonth] = " & [Combo87]

Chey said:
okay that didn't make any sense. Why would this have worked before with a
text but does not work with a date? I didn't use the wizard with the combo
box. I also have the combo box in the form header, along with the vendor
number combo box.
 
G

Guest

Thanks, that will be great.

default105 said:
First off, what I posted does make sense if you used a wizard but as I see
this is not your situations. I say that it is a formatting issue because as
you said it was text before and now it is date. Probably is trying to
compare two different formats. I will turn this over to someone else. I
thought it might have only been a error with the combo box reference. The
only other thing I can possibly think as a try is to use

"[tblGrantCompletion.theMonth] = " & [Combo87]

Chey said:
okay that didn't make any sense. Why would this have worked before with a
text but does not work with a date? I didn't use the wizard with the combo
box. I also have the combo box in the form header, along with the vendor
number combo box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top