Really Really Urgent Help Needed

Geoff Codd

Registered User.
Local time
Today, 07:41
Joined
Mar 6, 2002
Messages
190
I've got the following code that I can't get to work

If Me.NewRecord Then
Me!AddOrder.Visible = False
Me!PreviousRecord.Visible = False
Me!NextRecord.Visible = False
ElseIf Me.RecordCount = 1 Then
Me!AddOrder.Visible = True
Me!PreviousRecord.Visible = False
Me!NextRecord.Visible = False
Else
Me!AddOrder.Visible = True
Me!PreviousRecord.Visible = True
Me!NextRecord.Visible = True
End If

If It's a new record it hides buttons
if there is a record count of 1 then you can add
if there is more than one record you can add and navigate

Someone please help with what probably is something vey simple

Thanks
Geoff
 
You neglected to say what part does not work so I am guessing the RecordCount bit. Try:

ElseIf DCount("*","YourTableName") = 1 Then
 
Forgive me if this is a stupid reply, but I'm realy new w/ Access so I read all the topics to learn from your questions.

Don't you need 2 more "end if's" in there?

Looking forward to the answer!


Dave
 
Nope. If..Elseif..Else..End If is a single structure. Put 'If Then Else Statement' into Access help for a more complete explanation.
 

Users who are viewing this thread

Back
Top Bottom