Coding Issue - Compile Error

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
 
A

aMack

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
 
M

mscertified

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
 
A

aMack

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
 
A

aMack

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
 
M

mscertified

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
 

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

Top