On Format Event Procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PrimaryContact.Visible = (Me.PrimaryContact = True)
Me.24HRContact.Visible = (Me.24HRContact = True)
End Sub

The debugger points to <.24> as a compile error with an expected: =

Why is this and what can I do to correct?

THANKS!!!
 
John

Have you tried surround the fieldname with square brackets ([])?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I'm trying this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PrimaryContact.Visible = (Me.PrimaryContact = True)
Me.24HRContact.Visible = (Me.24HRContact = True)
End Sub

The debugger points to <.24> as a compile error with an expected: =

Why is this and what can I do to correct?

THANKS!!!

Does this work?
Me![24HRContact].Visible = (Me![24HRContact] = True)

You can shorten the code to:
Me![PrimaryContact].Visible = Me![PrimaryContact]
Me![24HRContact].Visible = Me![24HRContact]
 
JohnLute said:
I'm trying this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PrimaryContact.Visible = (Me.PrimaryContact = True)
Me.24HRContact.Visible = (Me.24HRContact = True)
End Sub

The debugger points to <.24> as a compile error with an expected: =

Why is this and what can I do to correct?


Names are not supposed to start with anything other than a
letter and contain anything other than letters an digits.
If you break any of those guidelines, then you must inclose
the name in [ and ]
 
As always - thanks to everyone for the help!

--
www.Marzetti.com


fredg said:
I'm trying this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PrimaryContact.Visible = (Me.PrimaryContact = True)
Me.24HRContact.Visible = (Me.24HRContact = True)
End Sub

The debugger points to <.24> as a compile error with an expected: =

Why is this and what can I do to correct?

THANKS!!!

Does this work?
Me![24HRContact].Visible = (Me![24HRContact] = True)

You can shorten the code to:
Me![PrimaryContact].Visible = Me![PrimaryContact]
Me![24HRContact].Visible = Me![24HRContact]
 

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

Back
Top