help with changing parameter in DMAX!

M

Mattias

Hi

Have this code working ok referencing to "Objekt" as a name of a table.
I have some problems to make it work when reference the query name of the
record source for the active form.

Thank you in advance

Mattias



Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.NewRecord Then
Me.Utropsnummer = DMax("Utropsnummer", "Objekt") + 1
End If
End Sub
 
S

Steve Schapel

Mattias,

What problems are you experiencing?

By the way, it seems to me that the 'If Me.NewRecord' line in your
code is not necessary... As far as I am aware, the BeforeInsert event
only takes place for new records anyway.

- Steve Schapel, Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top