How to determine if it's a new record? (1 Viewer)

FISHiEE

Fish obsessive
Local time
Today, 20:30
Joined
Nov 12, 2004
Messages
86
Hi,

I have a purchase order form and want to prevent the user from exiting the form before printing the purchase order.

This is fine in all cases except if the user is on the "new blank record" record (for want of a better description!) where the "printed" field is by default false. What condition do I need to check so I can ignore the rule and allow the user to exit if in the "new blank record" record?

Cheers!

John
 

FISHiEE

Fish obsessive
Local time
Today, 20:30
Joined
Nov 12, 2004
Messages
86
Actually managed to find this in the built in help! The following is how to determine if it's a new record you're on:

Dim int_newrec As Integer

int_newrec = Me.NewRecord
If int_newrec = True Then
MsgBox ("New Record!")
End If
 

Mile-O

Back once again...
Local time
Today, 20:30
Joined
Dec 10, 2002
Messages
11,316
FISHiEE said:
Code:
   Dim int_newrec As Integer

    int_newrec = Me.NewRecord
    If int_newrec = True Then
        MsgBox ("New Record!")
    End If

There's no need for the variable.

Code:
If Me.NewRecord Then
    MsgBox "New Record"
End If
 

Users who are viewing this thread

Top Bottom