Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS Outlook form (VBA Script)

    Post deleted by dreyes67

  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: MS Outlook form (VB Script)

    When you say a database, do you mean an MS Access or SQL Server database or something else?

    Do you have experience writing ADO or DAO code to query a database?

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> For the sake of clarity, it is better to specify VBA (VB for Applications) or VBS/VBScript rather than mixing the acronyms. Because it is an Outlook form, we know you most likely mean VBScript.

  3. #3
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook form (VB Script)

    Sorry for the general writing, this is MS Access database using ADO. I have never tried to query a database before.

    This is where I am starting to figure it out:
    '-=-=-=-=-=-=-=-=-=
    Sub Update06()
    Dim Obe
    Dim MyDB
    Dim Rst
    Dim Rsm

    Set MyDB = Dbe.Workspaces(0).OpenDatabase("J:edgartestcigarsn ewcigars3.mdb")
    RequestNum = UserProperties.Find("jobnum").Value
    Set Rst = MyDB.OpenRecordset("select * from dbtask where tasknum = " & RequestNum)
    If Rst.Fields("Form") = "Fonts" Then '(the names in this database do not have the Loggin User (vrUser)).
    Rst.Fields("Operator1") <> vrUser
    Rst.Fields("txtstatus") = "Finished"
    Rst.Fields("Date") = Now
    msgbox"This User is not Authorized to approve this request = " & vrUser
    'now exit the form.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MS Outlook form (VB Script)

    Before continuing to write code, can you try to explain in more detail what exactly you are trying to do? The code as posted doesn't make much sense to me.

  5. #5
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook form (VB Script)

    I have taken over several forms from someone else. The form - IT Change Control is used for programmers, Network, Mainframe workers to ask for permission to change code or HW. In this one it contains 7 multipages, I am working on page 1 and page 5. In Page 1, Explain why the change is necessary and in the Sector field it contains the name of the Group/Dept and it also identifyes the table where a list of names is kept t show who is authorized.

    User fills in Page 1 - Section = "Fonts". In the TO field they enter the Dept Managers name and send it.

    At this time the Dept manager opens the form...reviews page 1.. goes to page 5. At this time he will approve the request. Press the cmdbutton to update the request. At this time we capture the Date/Time, and the System Login ID (vrUser). Now I want to compare the vrUser name to the Section Table that was named in page 1... Fonts. If the names match then procced with the process.

    IF the vrUser name is not in the table (someone is signing for the Dept manger). I want to 1. Capture the Date/Time, Jobnumber, Current Loging ID (vrUser) and write that to dbViolation table. 2. Msgbox popup "This is a Security Violation... ", for the form to close/abort and exit.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MS Outlook form (VB Script)

    The naming is very confusing, the db prefix is commonly used to indicate a database (.mdb file), but here it is used to indicate a table (standard prefix is tbl)

    You will need two recordset objects, one for the lookup table, and one for the dbViolation table, but I'm afraid I still find your description too confusing.

Posting Permissions

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