Search results

  1. G

    using TransferSpreadsheet to specify a sheet

    Hi, I have looked around but still I am unable to find an answer. How do I use doCmd.TransferSpreadsheet to import an excel sheet to access. Here is what doesn't work: DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "DrawingSheet", fileName, True, "DrawingSheet" 'fileName is a...
  2. G

    Event Proceedure Help..

    In form design view, select the 2nd Listbox. Change the tab in the properties window to Event. click in "On Not in List", then click on the 3 dot button. Choose code builder and place the code you want to modify where the cursor is. Hope that makes sense and works
  3. G

    Loading... or Waiting... Pop-up

    Private Sub Form_Load() Me.TimerInterval = 2000 End Sub Private Sub Form_Timer() If Me.boxFlash.BackStyle = 0 Then Me.boxFlash.BackStyle = 1 Else Me.boxFlash.BackStyle = 0 End If End Sub Private Sub Form_Unload(Cancel As Integer) Me.TimerInterval = 0 End Sub...
  4. G

    Loading... or Waiting... Pop-up

    I do a simular thing on the form from which the reports are called. Using the TimerInterval and the Form_Timer() to animate the what you like. Also in the modules that run the calculations are reports, it required DoEvents to allow the Form_Timer event to run. I’m sure the same thing could be...
  5. G

    listbox question

    Yes that is possible. Private Sub lstMyList_AfterUpdate() debug.print Me.lstMyList.column(4) 'Selected row, column 5 debug.print Me.lstMyList.ListIndex 'The index of the selected row starting at 0
  6. G

    listbox question

    Private Sub lstMyList_AfterUpdate() Me.Recordset.FindFirst "[<fieldName>] = '" & Me.lstMyList.Column(0) & "'" myVariable = Me.lstMyList.Column(2) 'Third Coloum End Sub I think that might be what you are looking for, but im not to sure what is ment by
  7. G

    security

    I also have this problem, along with lots of people. So I have created access levels using the user name of the person loged on. Comparing LanUserID to a tblUsers UserID I then disable the menus and the shift key using Function SetBypassKey(rbFlag As Boolean) As String On Error GoTo...
  8. G

    Comparing LanUserID to a tblUsers UserID

    If DCount("[userID]", "tblUsers", "[userID] = '" & Environ("UserName") & "'") Then DoCmd.OpenForm "frmMenu" Else MsgBox "Access Denied" DoCmd.Close end if place this in the startup form's OnLoad event
  9. G

    rst.close vs. set rst=nothing

    I have been using both. db.Close Set db = Nothing Set db = Nothing clears up the memory used by the db reference. (my understanding)
  10. G

    Export to Excel

    This is one way to do it, its not the way you where trying to export. Dim sql As String Dim xlx As Object, xl As Object, xlw As Object, wb As Object '--DB Dim db As Database, rs As Recordset Set xlx = CreateObject("Excel.Application") Set xlw = xlx.workbooks.Open(reportLoc()) Set...
  11. G

    Centre

    Place this code in a module and run it. But I think you need the forms open for it to work. Public Sub setAutoCentre() '----------------------------------------------------------------------- ' Purpose : This sub routine will set the AutoCenter value to True for ' all forms open...
  12. G

    Centre

    This will work for each form that is open in form or design view. Dim i For i = 0 To Application.Forms.count - 1 Debug.Print Application.Forms(i).Name Application.Forms(i).AutoCenter = True Next i Just dont spend 2 hours trying to find a shortcut for a 1 hour task
  13. G

    Query To Textbox

    Try this one out, it should do what you are after. your version might work but just modify ID] = textbox1;" , to ID] = " & textbox1 & ";" if Customer ID is a text field you will need to put ' ' in as in the example below Dim db As Database, rs As Recordset, sql as String Set db =...
  14. G

    variable in a recordset field

    Not to sure what your trying to do, but have you tried. "rst ('" & Fieldname & "')" so then it should see it as rst('AFieldnameinTable1') -- GeK
  15. G

    save results from a query into an Array? - Newb Question

    Would this work for what you want to do. Set rs = db.OpenRecordset("SELECT accrualofdaysLOG.id, accrualofdaysLOG.Type, accrualofdaysLOG.numberdays FROM accrualofdaysLOG WHERE (((accrualofdaysLOG.id)=1));") While Not rs.EOF myArray(i,1) = rs.Fields("id") myArray(i,2) =...
  16. G

    Listbox select output to Excel

    Same Problem Ive been trying to do somthing very similar. And I was going to ask for help to, But I got it to work. My code does not do exaclty what amicar was after. This copies the same sheet twice to an empty workbook. Set xlx = CreateObject("Excel.Application") Set xlw =...
  17. G

    Modifying excel from Access VBA

    I have found that the following code works if the Shape is WordArt 1 or WordArt 2. After the second error this function is exited and the code runs from the calling method. Is there a better way to loop through errors, or to find out what the name of the wordArt is when it’s created...
  18. G

    combo-query!

    Might not be exact, but are you after somthing like this? Sub combo1_BeforeUpdate() combo2.rowSource = "SELECT ......" If combo2.ColumnCount = 0 then msgbox "Now Rows Found For This" Else .... End if End Sub If not, I need a better description. Todd
  19. G

    Modifying excel from Access VBA

    Hi, I have a database in Access with the Interface created in VBA, the reports are created in Excel by filling in each cell. Set xlw = xlx.workbooks.Open(reportLoc()) Set xl = xlw.worksheets("PMP") xl.Activate xl.cells(2, 8).Value = rs.Fields("xxxx") This work fine, but now I am...
Back
Top Bottom