Glowackattack
Registered User.
- Local time
- Today, 05:59
- Joined
- Feb 26, 2008
- Messages
- 126
Hi,
I am having problems with an access database i created a couple months ago, and i should probably start by saying i recently got a new computer and this is my first time using the database since(i am running access 03 on the new one too). Here is a breif overview of my setup, I have a form, and within it is a subform, and within the subform is another subform, i guess an easy way to describe is like this we have a case(main form info), which breaks down into policies(first subform), which breaks down into payment information for each policy (2nd subform). I have fields on the first subform that sums payment information for each policy, when i update information on the 2nd subform, i have the following code.
Everything worked fine in the past, and the field i wanted (type of premium) had focus after the update, now when i run this i get the error, if i comment out the last line, the premium amount field of the next record gets focus, not the "Type of Premium" field which i want....but at least i dont get an error and everything else updates like i want, i just want the Type of premium field to have focus for ease of data entry.
Please let me know if i can explain this better, and thanks for your help in advance.
I am having problems with an access database i created a couple months ago, and i should probably start by saying i recently got a new computer and this is my first time using the database since(i am running access 03 on the new one too). Here is a breif overview of my setup, I have a form, and within it is a subform, and within the subform is another subform, i guess an easy way to describe is like this we have a case(main form info), which breaks down into policies(first subform), which breaks down into payment information for each policy (2nd subform). I have fields on the first subform that sums payment information for each policy, when i update information on the 2nd subform, i have the following code.
Code:
Private Sub Premium_Amount_AfterUpdate()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim record As Integer
Dim ParentRecord As Integer
record = Me.CurrentRecord
ParentRecord = Me.Parent.CurrentRecord
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform].Form.Requery
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform].SetFocus
DoCmd.GoToRecord , , acGoTo, (ParentRecord)
[Frm_PolicyBreakdown_subform].Form.Requery
Forms![Frm_CaseOverview]![Frm_PolicyOverview_subform]![Frm_PolicyBreakdown_subform].SetFocus
DoCmd.GoToRecord , , acGoTo, (record + 1)
[Type of Premium].SetFocus
Everything worked fine in the past, and the field i wanted (type of premium) had focus after the update, now when i run this i get the error, if i comment out the last line, the premium amount field of the next record gets focus, not the "Type of Premium" field which i want....but at least i dont get an error and everything else updates like i want, i just want the Type of premium field to have focus for ease of data entry.
Please let me know if i can explain this better, and thanks for your help in advance.