Can't get my head around a requery

O

Opal

I have done this in the past without an issue, but can't seem to
get it to work on this particular database and I can't figure out
why.

I am running Access 2003. I have a form (frmConcern) bound
to a table - Concern. In the Form I have combo box (cboRank).
When the user selects a "rank" option (A, B or C) I want to
auto fill a txtRankDescription text box. I am using a hidden
subform bound to the Rank table to auto fill this text box.
The control source for the txtRankDescription is:
=subfrmRank.Form!Description

I have added the following code:

Private Sub cboRank_AfterUpdate()
Forms![frmConcern].[subfrmRank].Requery
End Sub

but if the user wishes to change the rank (from B to A, for example)
the subform does not re-query.

I have gotten this to work in the past with unbound forms and bound
subforms but this is the first time working with a bound form and I
cannot get the the sub form to requery properly. Could someone
please tell me what I am missing here? Thank you.
 
J

Jeanette Cunningham

Opal,
without knowing your setup, I usually do this type of thing using a hidden
column of the combo.
cboRank could have an extra column, its row source query could have
Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for column number
with whatever it is for your combo.

Jeanette Cunningham
 
O

Opal

Opal,
without knowing your setup, I usually do this type of thing using a hidden
column of the combo.
cboRank could have an extra column, its row source query could have
Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for column number
with whatever it is for your combo.

Jeanette Cunningham




I have done this in the past without an issue, but can't seem to
get it to work on this particular database and I can't figure out
why.
I am running Access 2003.  I have a form (frmConcern) bound
to a table - Concern.  In the Form I have combo box (cboRank).
When the user selects a "rank" option (A, B or C) I want to
auto fill a txtRankDescription text box.  I am using a hidden
subform bound to the Rank table to auto fill this text box.
The control source for the txtRankDescription is:
=subfrmRank.Form!Description
I have added the following code:
Private Sub cboRank_AfterUpdate()
   Forms![frmConcern].[subfrmRank].Requery
End Sub
but if the user wishes to change the rank (from B to A, for example)
the subform does not re-query.
I have gotten this to work in the past with unbound forms and bound
subforms but this is the first time working with a bound form and I
cannot get the the sub form to requery properly.  Could someone
please tell me what I am missing here?  Thank you.- Hide quoted text -

- Show quoted text -

Thank you Jeanette.... this is much easier.... so the
Me.txtRankDescription = Me.cboRank.Column(2)
should just appear in the After Update event for the
cboRank?
 
B

Bob Quintal

@m34g2000hsb.googlegroups.co
m:
Opal,
without knowing your setup, I usually do this type of thing using
a hidden
column of the combo.
cboRank could have an extra column, its row source query could
have Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for
column number with whatever it is for your combo.

Jeanette Cunningham


news:99bc6d7a-3ab5-49e3-8edd- (e-mail address removed)
.com...


I have done this in the past without an issue, but can't seem to
get it to work on this particular database and I can't figure
out why.
I am running Access 2003.  I have a form (frmConcern) bound
to a table - Concern.  In the Form I have combo box (cboRank).
When the user selects a "rank" option (A, B or C) I want to
auto fill a txtRankDescription text box.  I am using a hidden
subform bound to the Rank table to auto fill this text box.
The control source for the txtRankDescription is:
=subfrmRank.Form!Description
I have added the following code:
Private Sub cboRank_AfterUpdate()
   Forms![frmConcern].[subfrmRank].Requery
End Sub
but if the user wishes to change the rank (from B to A, for
example) the subform does not re-query.
I have gotten this to work in the past with unbound forms and
bound subforms but this is the first time working with a bound
form and I cannot get the the sub form to requery properly.
 Could someone please tell me what I am missing here?  Thank
you.- Hide quoted text -
- Show quoted text -

Thank you Jeanette.... this is much easier.... so the
Me.txtRankDescription = Me.cboRank.Column(2)
should just appear in the After Update event for the
cboRank?
Yes, if the rank description is the third column in the combobox row
source. the second column is (1) and the first is (0).

you can also just make the Description field's controlsource
= Me.cboRank.Column(2) and not put anything in the after_update
event.
 
O

Opal

@m34g2000hsb.googlegroups.co
m:




Opal,
without knowing your setup, I usually do this type of thing using
a hidden
column of the combo.
cboRank could have an extra column, its row source query could
have Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for
column number with whatever it is for your combo.
Jeanette Cunningham
news:99bc6d7a-3ab5-49e3-8edd-
(e-mail address removed)


.com...
I have done this in the past without an issue, but can't seem to
get it to work on this particular database and I can't figure
out why.
I am running Access 2003.  I have a form (frmConcern) bound
to a table - Concern.  In the Form I have combo box (cboRank).
When the user selects a "rank" option (A, B or C) I want to
auto fill a txtRankDescription text box.  I am using a hidden
subform bound to the Rank table to auto fill this text box.
The control source for the txtRankDescription is:
=subfrmRank.Form!Description
I have added the following code:
Private Sub cboRank_AfterUpdate()
   Forms![frmConcern].[subfrmRank].Requery
End Sub
but if the user wishes to change the rank (from B to A, for
example) the subform does not re-query.
I have gotten this to work in the past with unbound forms and
bound subforms but this is the first time working with a bound
form and I cannot get the the sub form to requery properly.
 Could someone please tell me what I am missing here?  Thank
you.- Hide quoted text -
- Show quoted text -
Thank you Jeanette.... this is much easier.... so the
Me.txtRankDescription = Me.cboRank.Column(2)
should just appear in the After Update event for the
cboRank?

Yes, if the rank description is the third column in the combobox row
source. the second column is (1) and the first is (0).

you can also just make the Description field's controlsource
= Me.cboRank.Column(2) and not put anything in the after_update
event.

--
Bob Quintal

PA is y I've altered my email address.

--
- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

Sorry Bob, I tried Jeannette's suggestion in the after update event
and it works, but
when I tried yours, I got

"#Name?"

In the text box
 
B

Bob Quintal

@f10g2000hsf.googlegroups.co
m:
@m34g2000hsb.googlegroups.co
m:




On Jan 31, 8:13 pm, "Jeanette Cunningham"
Opal,
without knowing your setup, I usually do this type of thing
using a hidden
column of the combo.
cboRank could have an extra column, its row source query could
have Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for
column number with whatever it is for your combo.
Jeanette Cunningham
(e-mail address removed)




I have done this in the past without an issue, but can't seem
to
get it to work on this particular database and I can't
figure out why.
I am running Access 2003.  I have a form (frmConcern) bound
to a table - Concern.  In the Form I have combo box
(cboRank). When the user selects a "rank" option (A, B or C)
I want to auto fill a txtRankDescription text box.  I am
using a hidden subform bound to the Rank table to auto fill
this text box. The control source for the txtRankDescription
is: =subfrmRank.Form!Description
I have added the following code:
Private Sub cboRank_AfterUpdate()
   Forms![frmConcern].[subfrmRank].Requery
End Sub
but if the user wishes to change the rank (from B to A, for
example) the subform does not re-query.
I have gotten this to work in the past with unbound forms
and bound subforms but this is the first time working with a
bound form and I cannot get the the sub form to requery
properly.  Could someone please tell me what I am missing
here?  Thank you.- Hide quoted text -
- Show quoted text -
Thank you Jeanette.... this is much easier.... so the
Me.txtRankDescription = Me.cboRank.Column(2)
should just appear in the After Update event for the
cboRank?

Yes, if the rank description is the third column in the combobox
row source. the second column is (1) and the first is (0).

you can also just make the Description field's controlsource
= Me.cboRank.Column(2) and not put anything in the after_update
event.

--
Bob Quintal

PA is y I've altered my email address.

--
-
Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

Sorry Bob, I tried Jeannette's suggestion in the after update
event and it works, but
when I tried yours, I got

"#Name?"

In the text box
If Jaannette's suggestion works, keep it. the #Name? indicates that
Access can't find the referenced control, often because of a typo,
or in this case, because some clown (me) forgot to strip off the Me.
when he copied and pasted the field name.
 
O

Opal

@f10g2000hsf.googlegroups.co
m:




@m34g2000hsb.googlegroups.co
m:
On Jan 31, 8:13 pm, "Jeanette Cunningham"
Opal,
without knowing your setup, I usually do this type of thing
using a hidden
column of the combo.
cboRank could have an extra column, its row source query could
have Description as an extra field from the Rank table.
then the code would look like this:
Me.txtRankDescription = Me.cboRank.Column(3)
Combo columns are numbered starting from 0. Replace (3) for
column number with whatever it is for your combo.
Jeanette Cunningham

(e-mail address removed)
.com...
I have done this in the past without an issue, but can't seem
to
get it to work on this particular database and I can't
figure out why.
I am running Access 2003.  I have a form (frmConcern) bound
to a table - Concern.  In the Form I have combo box
(cboRank). When the user selects a "rank" option (A, B or C)
I want to auto fill a txtRankDescription text box.  I am
using a hidden subform bound to the Rank table to auto fill
this text box. The control source for the txtRankDescription
is: =subfrmRank.Form!Description
I have added the following code:
Private Sub cboRank_AfterUpdate()
   Forms![frmConcern].[subfrmRank].Requery
End Sub
but if the user wishes to change the rank (from B to A, for
example) the subform does not re-query.
I have gotten this to work in the past with unbound forms
and bound subforms but this is the first time working with a
bound form and I cannot get the the sub form to requery
properly.  Could someone please tell me what I am missing
here?  Thank you.- Hide quoted text -
- Show quoted text -
Thank you Jeanette.... this is much easier.... so the
Me.txtRankDescription = Me.cboRank.Column(2)
should just appear in the After Update event for the
cboRank?
Yes, if the rank description is the third column in the combobox
row source. the second column is (1) and the first is (0).
you can also just make the Description field's controlsource
= Me.cboRank.Column(2) and not put anything in the after_update
event.
--
Bob Quintal
PA is y I've altered my email address.
--
-
Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Sorry Bob, I tried Jeannette's suggestion in the after update
event and it works, but
when I tried yours, I got

In the text box

If Jaannette's suggestion works, keep it. the #Name? indicates that
Access can't find the referenced control, often because of a typo,
or in this case, because some clown (me) forgot to strip off the Me.
when he copied and pasted the field name.

Hi Bob!

Thanks....I stripped off the "Me." and your suggestion works too :)
 

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