Storing value from a bound text box

  • Thread starter Claire Rohan via AccessMonster.com
  • Start date
C

Claire Rohan via AccessMonster.com

Hi I have a form which uses 2 linked combo boxes. The user selects from the
first combo box "Stock Index" and the second combo box "Stock" just shows
Stocks which are associated with that Stock Index. When the user selects the
Stock the currency is also selected and then the Currency text box is bound
to this i.e. =Stock.column(1). I also have a subform which is based on this
Currency (i.e. commission rates for the currency)
I have included the following code on the AfterUpdate procedure:

Private Sub Index_AfterUpdate()
Me!Stock = Null
Me!Stock.Requery
End Sub

It all works fine when I am just editing one record but the problem occurs
when I move to a different record. Although that record was entered correctly,
the Currency field is now blank and the drop down list of cmbStock contains
Stocks associated with the Stock Index of the last edited record. The Stock
Index and the Stock are correct as entered, although as I say the drop down
list is incorrect.

Please help!
 
M

Marshall Barton

Claire said:
Hi I have a form which uses 2 linked combo boxes. The user selects from the
first combo box "Stock Index" and the second combo box "Stock" just shows
Stocks which are associated with that Stock Index. When the user selects the
Stock the currency is also selected and then the Currency text box is bound
to this i.e. =Stock.column(1). I also have a subform which is based on this
Currency (i.e. commission rates for the currency)
I have included the following code on the AfterUpdate procedure:

Private Sub Index_AfterUpdate()
Me!Stock = Null
Me!Stock.Requery
End Sub

It all works fine when I am just editing one record but the problem occurs
when I move to a different record. Although that record was entered correctly,
the Currency field is now blank and the drop down list of cmbStock contains
Stocks associated with the Stock Index of the last edited record. The Stock
Index and the Stock are correct as entered, although as I say the drop down
list is incorrect.


Add the Me!Stock.Requery line to the form's Current event
procedure.
 
C

Claire Rohan via AccessMonster.com

Thanks a million!

Marshall said:
Hi I have a form which uses 2 linked combo boxes. The user selects from the
first combo box "Stock Index" and the second combo box "Stock" just shows
[quoted text clipped - 15 lines]
Index and the Stock are correct as entered, although as I say the drop down
list is incorrect.

Add the Me!Stock.Requery line to the form's Current event
procedure.
 

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