Brain Freeze help with combobox and query

K

kc-mass

Hi,

I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

Any help appreciated.

Kevin
 
M

Marshall Barton

kc-mass said:
I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

The Change event is inapproprate. You should use the
AfterUpdate event instead.

Me is not allowed outside of a class module, use the full
reference:
=Forms![form name].[cboEmployee] Or Is Null
 
K

kc-mass

Thanks Marshal but the form still does not refresh the data. It opens to
the first record and stays there no matter how many times i select something
from the combobox.

Further ideas appreciated. Driving me nuts.

Kevin


Marshall Barton said:
kc-mass said:
I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The
first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

The Change event is inapproprate. You should use the
AfterUpdate event instead.

Me is not allowed outside of a class module, use the full
reference:
=Forms![form name].[cboEmployee] Or Is Null
 
K

kc-mass

I just now had the afterupdate event do a debug.print of the cboemployee.
It prints out what appear to be ordinals showing the position of the
currently selected record. To check further I had it assign set a textbox
to be equal to the cboemployee. that shows a legitimate employeeID.

Any ideas???

Kevin


kc-mass said:
Thanks Marshal but the form still does not refresh the data. It opens to
the first record and stays there no matter how many times i select
something from the combobox.

Further ideas appreciated. Driving me nuts.

Kevin


Marshall Barton said:
kc-mass said:
I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The
first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against
the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

The Change event is inapproprate. You should use the
AfterUpdate event instead.

Me is not allowed outside of a class module, use the full
reference:
=Forms![form name].[cboEmployee] Or Is Null
 
K

kc-mass

Problem solved rebuilt form from scratch and works fine seems some level of
corruption.

Thanks


kc-mass said:
Thanks Marshal but the form still does not refresh the data. It opens to
the first record and stays there no matter how many times i select
something from the combobox.

Further ideas appreciated. Driving me nuts.

Kevin


Marshall Barton said:
kc-mass said:
I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The
first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against
the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

The Change event is inapproprate. You should use the
AfterUpdate event instead.

Me is not allowed outside of a class module, use the full
reference:
=Forms![form name].[cboEmployee] Or Is Null
 
M

Marshall Barton

Well, I am sure glad that you solved it because corruption
symptoms rarely relate to the real problem. We would have
been chasing all over the place trying to pin down the
inconsistent bahavior caused by any kind of corruption.
--
Marsh
MVP [MS Access]


kc-mass said:
Problem solved rebuilt form from scratch and works fine seems some level of
corruption.


kc-mass said:
Thanks Marshal but the form still does not refresh the data. It opens to
the first record and stays there no matter how many times i select
something from the combobox.

Further ideas appreciated. Driving me nuts.


kc-mass wrote:
I have a personnel form with typical personnel data. On the form is an
combo that has a data source of employeeID, LastName, First name. The
first
(0) column is bound to the combo.

The query that feeds the form references the combo as criteria against
the
employeeID.
=[ME].[cboEmployee] Or Is Null

The onchange event of the combo asks for a requery of the form

Private Sub cboEmployee_Change()
Requery
Debug.Print "it fired"
End Sub

The event fires but the form does not requery.

The Change event is inapproprate. You should use the
AfterUpdate event instead.

Me is not allowed outside of a class module, use the full
reference:
=Forms![form name].[cboEmployee] Or Is Null
 
V

vernal

i also have a similar problem ......................
have got a drop down list in excel say A, B, C, D, data..now this data has
got various other sub data to it.. i wan get this sub - data in the excel
format in such a way that if i click A i should only get that sub data for A
only and not for some thing else....so in the same cell if i clear the data A
to B i should get the list for only data B in the next cell
please help
m breaking my head over it
 
M

Marshall Barton

vernal said:
i also have a similar problem ......................
have got a drop down list in excel say A, B, C, D, data..now this data has
got various other sub data to it.. i wan get this sub - data in the excel
format in such a way that if i click A i should only get that sub data for A
only and not for some thing else....so in the same cell if i clear the data A
to B i should get the list for only data B in the next cell

If you are asking a question about something in MS Access,
you should translate it to what you are using in an Access
form.

If you are asking an Excel question, then you should post it
to an appropriate Excel forum.
 

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

Top