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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make IntelliSense show... 1

Status
Not open for further replies.

sucoyant

IS-IT--Management
Sep 21, 2002
213
US
Good day all!

This is probably a dumb question, but how do I make IntelliSense show the argument options for a Public Sub that I created?


Code:
Public Sub EmpRep(shtGrpName As String, ViewOrPrint As String, myForm As Form)

Dim strDocName As String
Dim strOut As String
Dim strWhere As String
Dim varItem As Variant
Dim varItem2 As Variant
Dim FirstLB As ListBox
Dim SecondLB As ListBox
Dim dateFrom As TextBox
Dim dateTo As TextBox

Set dateFrom = myForm.Controls("txt" & shtGrpName & "from") '''''''''''''''''''''''''
Set dateTo = myForm.Controls("txt" & shtGrpName & "to")                             'Set the references to the desired objects
Set FirstLB = myForm.Controls("lst" & shtGrpName & "_EMP") 'Employees ListBox       '
Set SecondLB = myForm.Controls("lst" & shtGrpName) 'Reports ListBox  ''''''''''''''''

strDocName = "Name of the report to Open"

dateFrom.SetFocus '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If dateFrom.Text = "" Then dateFrom.Value = "1/1/01"                                'If nothing is entered in the textboxes, we will enter and extreme
dateTo.SetFocus                                                                     'range to select everything.
If dateTo.Text = "" Then dateTo.Value = "12/12/12" ''''''''''''''''''''''''''''''''''

If SecondLB.MultiSelect > 0 Then
    If SecondLB.ItemsSelected.Count > 0 Then
        For Each varItem2 In SecondLB.ItemsSelected
        strDocName = SecondLB.ItemData(varItem2) 'Grab the first report selected
        strOut = ""                              'Clear the string strOut
        If FirstLB.MultiSelect > 0 Then
            If FirstLB.ItemsSelected.Count > 0 Then
            For Each varItem In FirstLB.ItemsSelected '''''''''''''''''''''''''''''''''
                On Error Resume Next                                                  'Enumerate through the employee listbox to
                strOut = strOut & "," & Chr(34) & FirstLB.ItemData(varItem) & Chr(34) 'grab all of the selected employees
                If Err = 2501 Then Err.Clear                                          '
            Next varItem ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
         strOut = Mid(strOut, 2)    'Truncate the leading ","
         strOut = "In(" & strOut & ")"
         Else
            MsgBox "Select At least one Employee"
         'Exit Sub
    
         End If
    End If '''''End first loop

    strWhere = "(" & "([Employee])" & strOut & ")"          'Format the Where statement for the docmd.openreport
    DoCmd.OpenReport strDocName, acViewPreview, , strWhere  'Open the current report

    Next varItem2
    Else
        MsgBox "Select a Report"
    'Exit Sub
    End If
End If

dateFrom.SetFocus
If dateFrom.Text = "1/1/01" Then dateFrom.Value = ""


dateTo.SetFocus
If dateTo.Text = "12/12/12" Then dateTo.Value = ""


End Sub


As you start typing EmpRep "REP", I would like the IntelliSense to show the acViewNormal and acViewPreview for the second argument ViewOrPrint.


How would I go about doing this?

Thanks in advance!


________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
I would like this to feed into the following line of code from the above post:

DoCmd.OpenReport strDocName, acViewPreview, , strWhere 'Open the current report


Where the second argument for OpenReport would consist of the ViewOrPrint variable.


This probably doesn't make sense... sorry. I'm horrid at explaining myself.

________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
Hi sucoyant,

Those values are a built-in enumeration, AcView. The easiest way is probably just to use it - change your procedure to ..

Code:
[blue]Public Sub EmpRep(shtGrpName As String, ViewOrPrint As [highlight]AcView[/highlight], myForm As Form)[/blue]

.. just remember, if you use values other than the enumeration inside the routine, you will be working with an Integer not a String.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
The easiest way is probably just to use it "
LOL! Yep... isn't that the truth.
Thanks for setting me straight... I didn't know you could do it that easily!

________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top