![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, First, I'm sorry to hear about the death of David Fenton who answered a couple of my questions and whose answers to others I found useful. I have a form built with the wizard based on a table. * One field in the table is an ID to another table. *The other table is tblRequestor, theat has columns ID, RequestorLastName, RequestorFirstName, RequestorType. I have a combo box based on a query to tblRequestor that shows. *So int he combo box the user sees a list of folks and when he chooses one, the ID field in the form is populated and gets saved in the underlying table. * I have a couple of fields in which I added to the form that display the last & first names of the requestor and the requestor type. * I use the combo box change event to update those fields whenever the user uses the combo box, like this: Private Sub cmbRequestor_Change() * * MsgBox ("Change combo box") * * txtReqLastName.Value = cmbRequestor.Column(1) * * txtReqFirstName.Value = cmbRequestor.Column(2) * * txtReqType.Value = cmbRequestor.Column(3) End Sub This works well. * However, I cannot seem to work out which event is triggered by using the arrows at the bottom of the form (the built in ones that access puts there). * *I should similarly update the txtReqLastName.Value and other fields when the user arrows to the next record. *What's the event? * And is there a way to step through the debugger and have it tell you about every form and object event that occurs? Any help appreciated. Mike |
#3
| |||
| |||
|
|
Hi All, First, I'm sorry to hear about the death of David Fenton who answered a couple of my questions and whose answers to others I found useful. I have a form built with the wizard based on a table. One field in the table is an ID to another table. The other table is tblRequestor, theat has columns ID, RequestorLastName, RequestorFirstName, RequestorType. I have a combo box based on a query to tblRequestor that shows. So int he combo box the user sees a list of folks and when he chooses one, the ID field in the form is populated and gets saved in the underlying table. I have a couple of fields in which I added to the form that display the last& first names of the requestor and the requestor type. I use the combo box change event to update those fields whenever the user uses the combo box, like this: Private Sub cmbRequestor_Change() MsgBox ("Change combo box") txtReqLastName.Value = cmbRequestor.Column(1) txtReqFirstName.Value = cmbRequestor.Column(2) txtReqType.Value = cmbRequestor.Column(3) End Sub This works well. However, I cannot seem to work out which event is triggered by using the arrows at the bottom of the form (the built in ones that access puts there). I should similarly update the txtReqLastName.Value and other fields when the user arrows to the next record. What's the event? And is there a way to step through the debugger and have it tell you about every form and object event that occurs? Any help appreciated. Mike |
#4
| |||
| |||
|
|
On 2012-01-25 6:47 PM, Gilgamesh wrote: Hi All, First, I'm sorry to hear about the death of David Fenton who answered a couple of my questions and whose answers to others I found useful. I have a form built with the wizard based on a table. * One field in the table is an ID to another table. *The other table is tblRequestor, theat has columns ID, RequestorLastName, RequestorFirstName, RequestorType. I have a combo box based on a query to tblRequestor that shows. *So int he combo box the user sees a list of folks and when he chooses one, the ID field in the form is populated and gets saved in the underlying table. * I have a couple of fields in which I added to the form that display the last& *first names of the requestor and the requestor type. * I use the combo box change event to update those fields whenever the user uses the combo box, like this: Private Sub cmbRequestor_Change() * * *MsgBox ("Change combo box") * * *txtReqLastName.Value = cmbRequestor.Column(1) * * *txtReqFirstName.Value = cmbRequestor.Column(2) * * *txtReqType.Value = cmbRequestor.Column(3) End Sub This works well. * However, I cannot seem to work out which event is triggered by using the arrows at the bottom of the form (the built in ones that access puts there). * *I should similarly update the txtReqLastName.Value and other fields when the user arrows to the next record. *What's the event? * And is there a way to step through the debugger and have it tell you about every form and object event that occurs? Any help appreciated. Mike Hi Mike, You could use the Form_Current event, which is triggered every time the record changes. There is no need to hook into the arrows at the bottom directly, since this event is always triggered when those buttons yield a different record. For the order of the various events, seehttp://office..microsoft.com/en-us/access-help/order-of-events-for-dat... However, if you simply set txtReqLastName.ControlSource (et al) to the function itself, you do not need ANY code as the control will be automatically recalculated whenever cmbRequestor changes. So, setting the ControlSource of the 3 text fields to : =cmbRequestor.Column(x) will have the desired effect without any code. HTH Jan T |
#5
| |||
| |||
|
|
On Jan 25, 11:47*am, Gilgamesh <michaelsfl... (AT) gmail (DOT) com> wrote: Hi All, First, I'm sorry to hear about the death of David Fenton who answered a couple of my questions and whose answers to others I found useful. I have a form built with the wizard based on a table. * One field in the table is an ID to another table. *The other table is tblRequestor, theat has columns ID, RequestorLastName, RequestorFirstName, RequestorType. I have a combo box based on a query to tblRequestor that shows. *So int he combo box the user sees a list of folks and when he chooses one, the ID field in the form is populated and gets saved in the underlying table. * I have a couple of fields in which I added to the form that display the last & first names of the requestor and the requestor type. * I use the combo box change event to update those fields whenever the user uses the combo box, like this: Private Sub cmbRequestor_Change() * * MsgBox ("Change combo box") * * txtReqLastName.Value = cmbRequestor.Column(1) * * txtReqFirstName.Value = cmbRequestor.Column(2) * * txtReqType.Value = cmbRequestor.Column(3) End Sub This works well. * However, I cannot seem to work out which event is triggered by using the arrows at the bottom of the form (the built in ones that access puts there). * *I should similarly update the txtReqLastName.Value and other fields when the user arrows to the next record. *What's the event? * And is there a way to step through the debugger and have it tell you about every form and object event that occurs? Any help appreciated. Mike Are you referring to Navigation buttons? *The Oncurrent event might be useful. *When you move to a new record the OnCurrent event is executed. You can then have code like this in the OnCurrent event * If Not Me.NewRecord then * * *'...initialize processes for an existing record * Else * * *'...initialize processes for a new record * Endif |
#6
| |||
| |||
|
|
On Jan 25, 10:45 am, Jan T<access... (AT) yahoo (DOT) com> wrote: On 2012-01-25 6:47 PM, Gilgamesh wrote: Hi All, First, I'm sorry to hear about the death of David Fenton who answered a couple of my questions and whose answers to others I found useful. I have a form built with the wizard based on a table. One field in the table is an ID to another table. The other table is tblRequestor, theat has columns ID, RequestorLastName, RequestorFirstName, RequestorType. I have a combo box based on a query to tblRequestor that shows. So int he combo box the user sees a list of folks and when he chooses one, the ID field in the form is populated and gets saved in the underlying table. I have a couple of fields in which I added to the form that display the last& first names of the requestor and the requestor type. I use the combo box change event to update those fields whenever the user uses the combo box, like this: Private Sub cmbRequestor_Change() MsgBox ("Change combo box") txtReqLastName.Value = cmbRequestor.Column(1) txtReqFirstName.Value = cmbRequestor.Column(2) txtReqType.Value = cmbRequestor.Column(3) End Sub This works well. However, I cannot seem to work out which event is triggered by using the arrows at the bottom of the form (the built in ones that access puts there). I should similarly update the txtReqLastName.Value and other fields when the user arrows to the next record. What's the event? And is there a way to step through the debugger and have it tell you about every form and object event that occurs? Any help appreciated. Mike Hi Mike, You could use the Form_Current event, which is triggered every time the record changes. There is no need to hook into the arrows at the bottom directly, since this event is always triggered when those buttons yield a different record. For the order of the various events, seehttp://office.microsoft.com/en-us/access-help/order-of-events-for-dat... However, if you simply set txtReqLastName.ControlSource (et al) to the function itself, you do not need ANY code as the control will be automatically recalculated whenever cmbRequestor changes. So, setting the ControlSource of the 3 text fields to : =cmbRequestor.Column(x) will have the desired effect without any code. HTH Jan T Brilliant! That's exactly what I needed. Thanks for the help. |
![]() |
| Thread Tools | |
| Display Modes | |
| |