Really Really Urgent Help Needed (1 Viewer)

Geoff Codd

Registered User.
Local time
Today, 15:42
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
 

Jack Cowley

Registered User.
Local time
Today, 15:42
Joined
Aug 7, 2000
Messages
2,639
You neglected to say what part does not work so I am guessing the RecordCount bit. Try:

ElseIf DCount("*","YourTableName") = 1 Then
 

bodhran1

Dazed and Confused
Local time
Today, 10:42
Joined
Mar 27, 2002
Messages
43
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
 

David R

I know a few things...
Local time
Today, 09:42
Joined
Oct 23, 2001
Messages
2,633
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

Top Bottom