Search results

  1. T

    Solved Query to return objects without inspections in the year

    Hi, I have 2 tables - tblObjects and tblInspections tblObjects has object_id (primary key) and object_name. tblInspections has inspection_id(INT primary key), inspection_name, inspection_date(Date/Time) and object_id (INT foreign key) I need to build query to show me all objects that DO NOT have...
  2. T

    Solved Move records (last, first, etc.) on subform with buttons on main form

    Hi, I have main form (Single Form - View) with unbound subform (Datasheet View). Тhese two forms are created with the same table. On the main form I have control buttons - "first", "last", "next", etc.. So, I need on the subform be show all entries and when I move previews or next record on the...
  3. T

    Disable only "paste" in excel

    Hello, how to disable only "paste" in excel?
  4. T

    Solved UNION query in VBA

    HI all, I need to create UNION query in VBA like this: SELECT [Inspector] FROM qryInspectors UNION SELECT Top 1 "- Department DZK -" FROM qryInspectors; Do I have to declare a variable like Dim sSQL As String sSQL = SELECT ....... Then I need to match with combobox like this...
  5. T

    Solved Change Row Source combobox depend of function "GetAccessLevel"

    Hi all. I need some help please. I am trying to change Row Source of ombobox depend of function "GetAccessLevel" I have Public Function GetAccessLevel() GetAccessLevel = Nz(DLookup("AccessLevel", "tblUsers", "UserName='" & GetUserName & "'"), 0) End Function and I have...
  6. T

    Solved Column summation calculations

    I need help to calculate a few columns, but I don't know how to do it. So: I have a workbook with 8 sheets - day1, day2, day3, day4, day5, day6, day7 and totalDay. In each sheet I have same table with 6 columns - column1, column2, column3, column4, column5, column6 Cell in each column is List...
  7. T

    Solved How to refer Exit button onClick event

    Hi everyone, On my unbounded pop up form "frmProducts" I need to write code that when I press Exit button onClick evetn to refer that: If combobox (cboType) on my subform "subfrmPSD" is = "somename" then DoCmd.GoToControl "InspectionTab" ElseIf my subform "subfrmPSD" is = "somename" then...
  8. T

    Solved Visible/ Invisible Tab pages

    I made 2 of 3 tab pages (with TabCtl514) invisible when loading the main form (frmInspecion) with the code: Private Sub Form_Load() Me.Prescriptions .Visible = False Me.Аcts.Visible = False End Sub The first tab page (with form frmPSD and Page Index 0) is always visible...
  9. T

    Solved How to add a new record in subform on open?

    Hi, all, How to open in add mode (acFormAdd) subform "frmPSD" (on Tab control - page "psdTab") on Main form "frmInspection"? Main form and subform are linked with Fields. The Main form "frmInspection" is open by another form with the code: Private Sub cboType_AfterUpdate() If Me.cboType =...
  10. T

    Validation subform

    Hi all, I have function name mdValidateData to validate data in my subform which is on Navigation Control - Page Index 0 On Main form I have the following codes: Private Sub Form_Load() 'Add controls in order ctls.Add Me![fm_PSD]![cboInspection] End Sub Private Sub Form_BeforeUpdate(Cancel...
  11. T

    Solved Filter subform

    Hi all, I need some help to filter my subform, which is made by query . What I miss and what needs to be added to the code to work? Private Sub cmdSearch_Click() Dim strQuery As String Dim strWhere As String Dim lngLen As Long Const conJetDate = "\#mm\/dd\/yyyy\#" strQuery...
  12. T

    The VBA code for filtering query doesn't work

    Good evening all. I have a problem with my query filtering code. I can't figure out where the problem is and why it doesn't work. Here is the code: Private Sub cmdReport_Click() Dim reportName As String Dim strQuery As String Dim strDateField As String Dim strWhere As String...
  13. T

    Solved Sum Expression columns in query

    Hi, is it possible to sum 3 expression columns in query and how to do it? The expression columns is: curruntInspection: Sum(IIf([Type] Like "curruntInspection*";1;Null)) targetedInspection: Sum(IIf([Type] Like"targetedInspection*";1;Null)) thematicInspection: Sum(IIf([Type] Like...
  14. T

    Copy tables from original DB to another

    Hi, I need to backup my database. I'm trying to copy tables from original database that is on a server, by pressing a button, to another database. I use this code, but it gives an error a error: Private Sub b1_Click() Dim FileNameOrig As String Dim FileNameCopy As String Dim d...
  15. T

    Solved Run-time error '2101'

    Hi, I have a subform with several required comboboxes. I have the following validation code: Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.Parent.objectID = "" Or IsNull(Me.Parent.objectID) Then MsgBox "Please select an object.", vbInformation, "Аttention!"...
  16. T

    Solved Subform required if main form has created new record

    Hi all, I need some help, pleas. I have main form with name "frmMain" and linked subform with name"subfrmSubForm". I need to make the subform "subfrmSubForm" and my filed "txtField" on subform required I . So if I have created new record on my main form "frmMain" I am obliged to fill in my...
  17. T

    Solved Need to marge 2 queries while removing duplicates

    Hi all, I need to marge 2 queries while removing duplicates My first query "qry1" has 3 fields: "id", "name" "hm". My second query "qry2" has the same fields as "qry1" I need to marge these two queries while removing duplicate records in field "id"
  18. T

    Solved Combination of two commands

    Hi, all. I need some help, please! I need to combine two messages with the corresponding commands. First I want to execute this command: Private Sub Form_BeforeUpdate(Cancel As Integer) If Not Nz(Me.cbo_PSD, "") = "" And Nz(Me.numbeрOfPproducts, "") = "" Then MsgBox "Please, enter...
  19. T

    Solved How to Sort report by 2 fields

    Hi all, I need to Sort my report by 2 fields. Now when I open my report it is sorted by date. But I want next to sort by second field sort "name" I filter my report with this code: Private Sub cmd_Report_Click() 'On Error GoTo Err_Handler 'Remove the single quote from start of...
  20. T

    Solved "Show All" in unbound combobox

    Hi all, I need some help, please. I have list with names in the combobox and a search button. When I press the search button it shows me a report of all the names with this code: Private Sub cmd_SearchClick() 'On Error GoTo Err_Handler 'Remove the single quote from start of this line...
Top Bottom