Coding Issue - Compile Error

  • Thread starter Thread starter aMack
  • Start date Start date
A

aMack

I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
No change .

When the error appears -

The first line is highlighted in yellow.

A section of the second line ".Customer_#" is highlighted grey.

Anything?

Thanks
--
A MACKENZIE, CMA, MBA


mscertified said:
see below

aMack said:
I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True <=============== no Cancel parm in this sub
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
If (Me.Customer_#) Is Null Then

is invalid, try

If IsNull(Me.Customer_#) Then


-Dorian

aMack said:
No change .

When the error appears -

The first line is highlighted in yellow.

A section of the second line ".Customer_#" is highlighted grey.

Anything?

Thanks
--
A MACKENZIE, CMA, MBA


mscertified said:
see below

aMack said:
I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True <=============== no Cancel parm in this sub
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
Makes sense - but no change.

I changed the filed name to customer num thinking the "#" sign was a problem
but no difference either.

Also [Customer #] was set as "Locked" - took that off and still no help.

Any other ideas?

--
A MACKENZIE, CMA, MBA


mscertified said:
If (Me.Customer_#) Is Null Then

is invalid, try

If IsNull(Me.Customer_#) Then


-Dorian

aMack said:
No change .

When the error appears -

The first line is highlighted in yellow.

A section of the second line ".Customer_#" is highlighted grey.

Anything?

Thanks
--
A MACKENZIE, CMA, MBA


mscertified said:
see below

:

I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True <=============== no Cancel parm in this sub
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
Success - I re-wrote the code and the filed name came up as [Customer_]
without the # sign.

It worked.

Thanks


--
A MACKENZIE, CMA, MBA


mscertified said:
If (Me.Customer_#) Is Null Then

is invalid, try

If IsNull(Me.Customer_#) Then


-Dorian

aMack said:
No change .

When the error appears -

The first line is highlighted in yellow.

A section of the second line ".Customer_#" is highlighted grey.

Anything?

Thanks
--
A MACKENZIE, CMA, MBA


mscertified said:
see below

:

I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True <=============== no Cancel parm in this sub
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
Its best to not use any special characters in column names - strange things
can happen. Avoid embedded blanks too.

-Dorian

aMack said:
Success - I re-wrote the code and the filed name came up as [Customer_]
without the # sign.

It worked.

Thanks


--
A MACKENZIE, CMA, MBA


mscertified said:
If (Me.Customer_#) Is Null Then

is invalid, try

If IsNull(Me.Customer_#) Then


-Dorian

aMack said:
No change .

When the error appears -

The first line is highlighted in yellow.

A section of the second line ".Customer_#" is highlighted grey.

Anything?

Thanks
--
A MACKENZIE, CMA, MBA


:

see below

:

I get a "Compile Error - method or data not found" for the following coding:

Private Sub Ready_to_Bill_Enter()
If (Me.Customer_#) Is Null Then
MsgBox "Cannot INVOICE if No Order #"
Cancel = True <=============== no Cancel parm in this sub
Me.Customer_#.SetFocus
End If
End Sub

[Ready to Bill] is a "Yes/No" field
[Customer #] is a "Text" field

The results I am loking for is that a user cannot change [OK to Bill] if
there is no [Customer #]

Thanks
 
Back
Top