Command button to increment field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a form on which I need to use a cmd button to increment a line item
which is not an autonumber. The button saves the current information and
increments the other line item field. I am stumped. Thank you!
Karl
 
On the before Update you could do the following

Me!FieldWhichIsNotAutoNumber =
DMAX("FieldWhichIsNotAutoNumber","TableFieldExistsIn") + 1
 
Hi John,
Thank you for your help. I tired:

'Saves record of bill and tries to advance line #
Private Sub cmdPostItem_Click()
On Error GoTo Err_cmdPostItem_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me!LineNo = _
DMax("LineNo", "tblCafeBillDetail") + 1
Exit_cmdPostItem_Click:
Exit Sub

and this didn't work. Am I missing another bang notation? I tired putting
your suggested script above the DoCmd and that didn't work either.
Thanks again,
Karl
 
Back
Top