DMAX function with autonumber

punter

Registered User.
Local time
Today, 03:03
Joined
Nov 24, 2006
Messages
108
Hi,

Below is the macro that has been recorded in access:

Option Compare Database
Option Explicit

Private Sub Add_record_to_database_Click()
On Error GoTo Err_Add_record_to_database_Click


DoCmd.GoToRecord , , acNewRec

Exit_Add_record_to_database_Click:
Exit Sub

Err_Add_record_to_database_Click:
MsgBox Err.Description
Resume Exit_Add_record_to_database_Click

End Sub
Private Sub Add_new_record_once_you_written_down_Unqiue___Click()
On Error GoTo Err_Add_new_record_once_you_written_down_Unqiue___Click


DoCmd.GoToRecord , , acNewRec

Exit_Add_new_record_once_you_written_dow:
Exit Sub

Err_Add_new_record_once_you_written_down_Unqiue___Click:
MsgBox Err.Description
Resume Exit_Add_new_record_once_you_written_dow

End Sub
Private Sub Add_new_record_Click()
On Error GoTo Err_Add_new_record_Click


DoCmd.GoToRecord , , acNewRec

Exit_Add_new_record_Click:
Exit Sub

Err_Add_new_record_Click:
MsgBox Err.Description
Resume Exit_Add_new_record_Click



End Sub


Here is the piece I'm tryhing to add to the macro:

DMAX("Unique #", "BOL Information") + 1

I have been trying various combinations but I can't get it work. Any thoughts?

Thank you in advance,

Eddie.
 
KeithG said:
What error are you receiving?


Various ones. I'm getting "expects =" sometimes and other systax errors.

It seems to me the code should fit in there somewhere but I'm not sure where. Am I barking up the wrong tree?

Thank you for your reply.

Eddie.
 

Users who are viewing this thread

Back
Top Bottom