Define Variable Error

  • Thread starter misschanda via AccessMonster.com
  • Start date
M

misschanda via AccessMonster.com

Hello,
I am gettting the following error: Compile Error Variable not Define. and is
pointing to the following

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
Result = C128(txtid, Me, 10, False, , 0)
End Sub

With txtid being highlighted.

How exactly could this be fixed???

Thanks

The entire sql is:


Option Explicit

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Dim strSampleType
Dim strMatrix

strSampleType = Me.txtType
strMatrix = Me.txtMatrix
Me.NTI_SampleLabels_Female.Visible = True
Me.NTI_SampleLabels_Gender.Visible = True
Me.NTI_SampleLabels_Man.Visible = True
Me.NTI_SampleLabels_Boss.Visible = True
If strSampleType = "Female" Then
Me.NTI_SampleLabels_Female.Visible = True
Me.NTI_SampleLabels_Gender.Visible = False
Me.NTI_SampleLabels_Man.Visible = False
Me.NTI_SampleLabels_Boss.Visible = False
ElseIf strSampleType = "Boss" Then
Me.NTI_SampleLabels_Boss.Visible = True
Me.NTI_SampleLabels_Female.Visible = False
Me.NTI_SampleLabels_Gender.Visible = False
Me.NTI_SampleLabels_Man.Visible = False
ElseIf strMatrix = "MAN" Then
Me.NTI_SampleLabels_Man.Visible = True
Me.NTI_SampleLabels_Female.Visible = False
Me.NTI_SampleLabels_Gender.Visible = False
Me.NTI_SampleLabels_Boss.Visible = False
Else
Me.NTI_SampleLabels_Gender.Visible = True
Me.NTI_SampleLabels_Man.Visible = False
Me.NTI_SampleLabels_Boss.Visible = False
Me.NTI_SampleLabels_Female.Visible = False
End If

End Sub

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
Result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 10, False, , 0)
End Sub
 
D

Douglas J. Steele

What is txtid supposed to be: the value in a control on your form? Try
Me.txtid instead. If that doesn't work, make certain that the control name
really is txtid.
 
M

misschanda via AccessMonster.com

Thanks for the reply.

txtid is really txtidautomationbc1. which appears in the code

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
Result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 10, False, , 0)
End Sub

it is a label for the control samplenumber on many reports i am making.

I am getting the errors varible not define which lead me to do the following:

Dim strsamplenumber
strsamplenumber = Me.txtIDAutomationBC1

upon doing so I received another error:

Byref argument type mismatch, which highlighted txtIDautomationBC1.

any more suggestions??


What is txtid supposed to be: the value in a control on your form? Try
Me.txtid instead. If that doesn't work, make certain that the control name
really is txtid.
Hello,
I am gettting the following error: Compile Error Variable not Define. and
[quoted text clipped - 52 lines]
Result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 10, False, , 0)
End Sub
 
D

dymondjack

If txtid is the name of a label, there will not be a value for it, which may
be why you are getting a type mismatch. Passing txtid as an argument may be
trying to pass the label itself (as an object), which the receiving end of
the argument may not be set up for.

If you want to refer to the text in the label, try Me.txtid.Caption

hth
--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill


misschanda via AccessMonster.com said:
Thanks for the reply.

txtid is really txtidautomationbc1. which appears in the code

Private Sub Detail1_Print(Cancel As Integer, PrintCount As Integer)
Result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 10, False, , 0)
End Sub

it is a label for the control samplenumber on many reports i am making.

I am getting the errors varible not define which lead me to do the following:

Dim strsamplenumber
strsamplenumber = Me.txtIDAutomationBC1

upon doing so I received another error:

Byref argument type mismatch, which highlighted txtIDautomationBC1.

any more suggestions??


What is txtid supposed to be: the value in a control on your form? Try
Me.txtid instead. If that doesn't work, make certain that the control name
really is txtid.
Hello,
I am gettting the following error: Compile Error Variable not Define. and
[quoted text clipped - 52 lines]
Result = IDAutomation_NatG_C128(txtIDAutomationBC1, Me, 10, False, , 0)
End Sub
 

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