Search results

  1. waxdart23

    Passing Date values from form to module

    I currently use - Call UpdatePerformanceAdd(StewID.Value) to pass an integer value to a module for use in the VB code - Public Sub UpdatePerformanceAdd(lStew_Num As Long) I know wish to pass two date values from the same form to the same module to use in a query in the module. I'm not sure how...
  2. waxdart23

    Using value from table in VB

    I am using the follwing code to count the number of records returned to a list box from a query - If Not Recset.BOF And Not Recset.EOF Then Recset.MoveFirst Recset.MoveLast NoOfPeriods = .RecordCount Else NoOfPeriods = 0 End If The same query returns a value of days (stored as an integer) to the...
  3. waxdart23

    Compile Error with Form Code

    I have a form which, after selecting a "Staff" record and a year from two seperate comb boxes should list all sickness records for the selections in a list box. I am using the following code to do this - Private Sub cmbYearSelect_AfterUpdate() Dim StartDate As Date Dim EndDate As Date...
  4. waxdart23

    Filtering displayed data on subform

    I have a database used to store staff sickness. It currently consists of a "Staff" table to store staff details (name, number, salary etc) and a "Sickness" table to store sickness records. I have produced a form to displaying staff's name from "Staff" table and then a sub form containing...
  5. waxdart23

    Run-Time error '424'

    I am using the following to pass two items of data from a form to a Module - Call UpdatePerformanceAdd(StewID.Value, StartDate.Value) The module is as follows - Public Sub UpdatePerformanceAdd(lStew_Num As Long, lStartDate As Date) Dim Dbs As Database: Set Dbs = CurrentDb Dim rstPerf...
  6. waxdart23

    Formatting values for time

    I am trying to add a range of time durations on a form but when the total value of hours is larger than 24 it goes back to zero. eg If the total amount of hours is 40hours 30minutes then the total shows as 16:30. Is there a formatting I can use so that Access recognises that a time is a value...
  7. waxdart23

    Exporting Pivot Table

    I use the following code to export (from a form) the results of a saved query (Hoursworked) to Excel. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "HoursWorked", "C:\path\hoursworked.xls" MsgBox "Hours Worked Exported.", vbInformation, "Message" I know have a pivot...
  8. waxdart23

    Counting a query

    In a rostering database, I am using the following to list "Stewards" who are available to work (in a venue for a performance). These are displayed in an unbound text box called lstSteward. Private Sub cmbPerformance_AfterUpdate() If IsNull(cmbPerformance) Then lstSteward.RowSource...
  9. waxdart23

    Analysis with Excel

    I have some queries which I would like to export (analyze) in Excel. At the moment I do this by highlighting the query and clicking on the "Analyze it with Excel" button which then opens the data in Excel. However, I wish to let other people use the database and so wish to hide the database...
  10. waxdart23

    Creating new table with user specified name

    I have a form which has "Start_Date", "End_Date" and "TableName" text fields and I am trying to create a new table using these parameters. I have a command button with the following code - Dim strSQL As String strSQL = "SELECT StewardDetails.First_Name, StewardDetails.Last_Name...
Top Bottom