Results 1 to 4 of 4

Thread: skip step

  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    skip step

    I have a procedure that will check to see if a Control number as been
    assigned to a request form. If there is a number, then I assume that the
    request was turned in wrong and they made the changes needed so
    they "resubmit" the request. At this point I look for a response=6. At
    this time I also check to see who the currentuser is.

    At this time, I want it to compare the vruser (currentuser) to a list of
    names(somehow) and to skip this step. If the name is not in a "list" then
    to let it continue with the resubmit funciton.

    Can anyone help me with this step?


    'On error resume next
    Set Dbe = Application.CreateObject("DAO.DBEngine.35")
    If Err.Number <> 0 Then
    Msg Err.Description & " Some functions may not work correctly" _
    & Chr(13) & "make sure that Dao 3.5 is installed on this machine"
    Exit Function
    End If

    'Check to see if this is from scratch

    Set MyDB = Dbe.Workspaces(0).OpenDatabase("C:cigarsroom.mdb")
    Set Rst = MyDB.OpenRecordset("dbtask")

    If UserProperties.Find("jobnum").Value > 0 Then
    response = Msgbox("Is this a Resubmited Job
    Request?",vbYesNo,"Initializing")
    If response =6 then

    CounterStart = 1
    Counter = Rst.RecordCount + CounterStart
    set nms= application.getnamespace("mapi")
    vrUser=nms.currentuser

    UserProperties.Find("jobnum").Value = Counter
    UserProperties.Find("Reqby").Value = vrUser
    UserProperties.Find("txtstatus").Value = "Submit"
    UserProperties.Find("jobtype").Value = "Modem Files"

    Rst.AddNew
    Rst("Tasknum") = Counter
    Rst("txtstatus") = "Submit"
    Rst("jobtype") = "Modem Files"
    Rst.fields(4).value=vrUser
    Rst.Update
    Rst.Close
    MyDB.Close
    'Else
    ' msgbox("This is a Resubmitted job")
    End if
    Else

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: skip step

    > I want it to compare the vruser (currentuser) to
    > a list of names(somehow)

    What is your data source?

    (1) Existing database: you can query the database for a matching value.

    (2) Text file (e.g., exported from Word, Excel, or a database): You can iterate through the file checking for a matching value.

    (3) Hardcoded: you can check an array or string for a matching value. (e.g., use Instr(strAllNames, strCurrUser & "^") where the names in strAllNames are each followed by a caret)

    Does this help?

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: skip step

    There are just a handful of names that I want to compare against, so I will probably hardcode the names into it.

    Do I just add Instr(strAllNames, strCurrUser & "^") and where would I add it.

    Thank you

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: skip step

    At the point in your code where you know the strCurrentUser and want to skip based on that value:

    If Instr(1, "Able^Baker^Charlie^", strCurrUser & "^", vbTextCompare) = 0 Then
    'This user is not on the list; do what I do
    Else
    'This user is on the list; do what I do
    End If

    If the capitalization is guaranteed to be consistent, you can delete the vbTextCompare switch.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •