If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
tab order
I have a form with 2 subforms' Bills and Payments. When bills are logged the
Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#2
|
|||
|
|||
tab order
First, will you *always* want to go to a new record in the Bills subform
when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#3
|
|||
|
|||
tab order
On Sat, 4 Nov 2006 12:53:01 -0800, Cary Bishop
wrote: I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. Ummm... If you want to allow multiple records in the Payments subform, why would you want to make it hard to get to the new record on the subform to enter one? That would be the effect! If you *do* want to do this, put a textbox on the Payments subform last in the tab order. It must be vixible, but it can be hidden behind another control so the user can't mouse into it. In its GotFocus event put code like Private Sub txtRelay_GotFocus() Parent.SetFocus Parent!Bills.SetFocus ' set focus to the other subform DoCmd.GoToRecord acForm, "[Forms]![formname]![Bills]", acNewRecord Parent!Bills.Form!txtFirstControl.SetFocus ' then to a control on it John W. Vinson[MVP] |
#4
|
|||
|
|||
tab order
I will always want to go to a new record in the Bills subform when logging
tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#5
|
|||
|
|||
tab order
Try this:
Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#6
|
|||
|
|||
tab order
Ken,
I tried it but got a Run-time error '2465', Application defined or object-defined error. I double checked my typing and the subform names and control names but everything looked okay. -- cbishop "Ken Snell (MVP)" wrote: Try this: Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#7
|
|||
|
|||
tab order
On which line of code do you get the error?
Might be necessary to move focus to main form first: Private sub Tax_Install_Paid_Date_Exit Me.Parent.NameOfAControlOnMainForm.SetFocus Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... Ken, I tried it but got a Run-time error '2465', Application defined or object-defined error. I double checked my typing and the subform names and control names but everything looked okay. -- cbishop "Ken Snell (MVP)" wrote: Try this: Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#8
|
|||
|
|||
tab order
The first line.
I'm sorry, I meant to include that. -- cbishop "Ken Snell (MVP)" wrote: On which line of code do you get the error? Might be necessary to move focus to main form first: Private sub Tax_Install_Paid_Date_Exit Me.Parent.NameOfAControlOnMainForm.SetFocus Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... Ken, I tried it but got a Run-time error '2465', Application defined or object-defined error. I double checked my typing and the subform names and control names but everything looked okay. -- cbishop "Ken Snell (MVP)" wrote: Try this: Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#9
|
|||
|
|||
tab order
Did you try the modified code that I posted?
-- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... The first line. I'm sorry, I meant to include that. -- cbishop "Ken Snell (MVP)" wrote: On which line of code do you get the error? Might be necessary to move focus to main form first: Private sub Tax_Install_Paid_Date_Exit Me.Parent.NameOfAControlOnMainForm.SetFocus Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... Ken, I tried it but got a Run-time error '2465', Application defined or object-defined error. I double checked my typing and the subform names and control names but everything looked okay. -- cbishop "Ken Snell (MVP)" wrote: Try this: Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
#10
|
|||
|
|||
tab order
Yes, I wrote the first line as:
Me.Parent.frmJurisdictions.cboJurisdiction.SetFocu s I tried it with the same results and the debugger highlighted the first line of code. I then deleted the frmJurisdictions out of the code and tried again, same results. -- cbishop "Ken Snell (MVP)" wrote: Did you try the modified code that I posted? -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... The first line. I'm sorry, I meant to include that. -- cbishop "Ken Snell (MVP)" wrote: On which line of code do you get the error? Might be necessary to move focus to main form first: Private sub Tax_Install_Paid_Date_Exit Me.Parent.NameOfAControlOnMainForm.SetFocus Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... Ken, I tried it but got a Run-time error '2465', Application defined or object-defined error. I double checked my typing and the subform names and control names but everything looked okay. -- cbishop "Ken Snell (MVP)" wrote: Try this: Private sub Tax_Install_Paid_Date_Exit Me.Parent.fsubTax_Bills.SetFocus Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus Me.Parent.fsubTax_Bills.Form.Recordset.AddNew Me.Parent.fsubTax_Bills.Form.Company_ID.SetFocus End Sub -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I will always want to go to a new record in the Bills subform when logging tax bills. I didn't understand your code, but here is my attempt to use it. subform: fsubTax_Bills; first control on form: Company_ID subform: fsubPayments; last control on form: Tax_Install_Paid_Date Private sub Tax_Install_Paid_Date_Exit Me.Parent.Company_ID.SetFocus Me.Parent.Company_ID.fsubTax_Bills.Company_ID Me.Parent.Company_ID.fsubTax_Bills.Recordset.AddNe w End Sub Thanks for your help -- cbishop "Ken Snell (MVP)" wrote: First, will you *always* want to go to a new record in the Bills subform when you finish entering the data on the Payments subform? If not, you shouldn't program the form to do that all the time. You could put a button on the Payments subform that, when clicked, would take you to a new record on Bills subform: Private Sub ButtonName_Click() Me.Parent.NameOfSubformControlHoldingBillsSubform. SetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.NameOfControlInBillssubformSetFocus Me.Parent.NameOfSubformControlHoldingBillsSubform. Form.Recordset.AddNew End Sub Otherwise, if you always want to make the move, the code above can be put in the Exit event of the last control of the Payments subform(assuming that there is only one record in that subform). If you have multiple records in the Payments subform, things get complicated to run automatic code, as you'd need to test if you're on the last record and make the move only if it's the last record. -- Ken Snell MS ACCESS MVP "Cary Bishop" wrote in message ... I have a form with 2 subforms' Bills and Payments. When bills are logged the Bills subform is completed populated and the Payments subform is partially populated. I want to be able to tab through the last field of the Payments subform and return to the first field of a new record in the Bills subform. The reason I have a payments table is that I may have multiple installments to pay the bill. Thanks in advance. -- cbishop |
|
Thread Tools | |
Display Modes | |
|
|