Results 1 to 3 of 3

Thread: Solved: Password on a value of a listbox

  1. #1

    Solved: Password on a value of a listbox

    Im looking to put password on one of my value of the listbox and run a code when they click "Export EADM Updates"..they'll put a password..then it'll run that ElseIf statement.

    [VBA]'TYPE: Sub
    'NAME: ComboInfo_Click()
    'Parameters: none
    'Purpose: Open the forms designated as Information Catalogue forms.
    Private Sub ComboInfo_Click()

    ElseIf ComboInfo.Text = "Export EADM Updates" Then

    Dim rst As Recordset
    Dim dst As Recordset
    Dim pst As Recordset
    Dim lst As Recordset
    Dim objApp As Excel.Application
    Dim objBook As Excel.Workbook
    Dim objSheet As Excel.Worksheet
    Set objApp = New Excel.Application

    On Error Resume Next
    'This is new 'Your excel spreadsheet file goes here
    Set objBook = objApp.Workbooks.Open("I:\Status\EADMUpdates.xlsm")
    'Name of sheet you want to export to
    Set objSheet = objBook.Worksheets(1)
    objBook.Windows(1).Visible = True
    'Opens the Query recordset
    Set rst = CurrentDb.OpenRecordset("SupplyRetailOffering")
    Set dst = CurrentDb.OpenRecordset("MarketingBusinessParty")
    Set pst = CurrentDb.OpenRecordset("BusinessOperationsandPlan")
    Set lst = CurrentDb.OpenRecordset("FinancialEnterpriseHumanResources")

    'Clears the current contents in the workbook range
    'With objApp.Application.Selection
    ' .ClearContents
    'End With
    'rst/dst Copies the recordset into the worksheet
    objSheet.Range("A2").CopyFromRecordset rst
    objSheet.Range("A19").CopyFromRecordset dst
    objSheet.Range("A33").CopyFromRecordset pst
    objSheet.Range("A50").CopyFromRecordset lst
    objApp.Visible = False
    MsgBox "Excel has been Updated.If Error - No Access"

    MsgBox "Please make a selection."
    End If

    End Sub

  2. #2
    VBAX Guru
    Mar 2005
    Where is the Password stored?

  3. #3
    Quote Originally Posted by OBP
    Where is the Password stored?
    oh, i solved it using a inputbox
    and used an if statement to match it to a string password.

Posting Permissions

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