Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Function/Aub Issues 1

Status
Not open for further replies.

kermitforney

Technical User
Mar 15, 2005
374
US
Having some issues with the code below"
Code:
Public Function fncInt2Bin(n As Long, Optional bReverse = False) As String
    Dim m
    m = n
    Do
        If bReverse Then
            Dec2Bin = Dec2Bin & m Mod 2
        Else
            Dec2Bin = m Mod 2 & Dec2Bin
        End If
        m = Int(m / 2)
    Loop Until m <= 0
End Function

End Function

Public Sub ControlNumber()
Dim InvoiceID As int32
Dim ControlNumber As Long

InvoiceID = Me.txtInvoiceID.Text
ControlNumber = InvoiceID(fcnInt2Bin)

Me.txtControlNumber = ControlNumber

End Sub

I am trying to assign the text box (txtControlNumber) to the variable (ControlNumber), but it is not working for some reason. Do I have to input information into the Control Source of the text box?? Help!!!

Thanks in advance!! :eek:)
 
Is it in the module that belongs to the report or in a standard module? Does your code compile? Can you run fncInt2Bin from the immediate window:

?fncInt2Bin(150)

for example.
 
It is in the module that belongs to the report. Checking others . . .
 
Have it working Rem, but I have some adverse affects that I have posted in a previous post. Thanks for all of your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top