skyline666
Programmer
Hi,
I have a form called Category and subform called Risk in an Access 2003 project. I originally wanted the subform to go to the last record when a button called "AddNewRisk" was pressed (which added a new row to the subform), but I have that sorted. What I would like to do is go to the last record as it does now, but also go to a named field aswell (the field being RiskDetails, the second field in the subform). This is becuase the first field, RiskID, is a unique number that gets automatically put in when the add button is pressed. As this is automatically put in, instead of the user having to go to the next field, I would like it to go to the second field when the button is pressed. The code used so far for going to last record is:
where the first line is for the command button, second line then refreshes the subform, and the third/fourth line go to the last record.
Many thanks,
Andrew
I have a form called Category and subform called Risk in an Access 2003 project. I originally wanted the subform to go to the last record when a button called "AddNewRisk" was pressed (which added a new row to the subform), but I have that sorted. What I would like to do is go to the last record as it does now, but also go to a named field aswell (the field being RiskDetails, the second field in the subform). This is becuase the first field, RiskID, is a unique number that gets automatically put in when the add button is pressed. As this is automatically put in, instead of the user having to go to the next field, I would like it to go to the second field when the button is pressed. The code used so far for going to last record is:
Code:
AddNewRisk strRiskID, Me.ProjectID, intSeq, Me.CategoryID
Me.Risk.Requery
DoCmd.GoToControl "Risk"
DoCmd.GoToRecord , , acLast
Many thanks,
Andrew