Search results

  1. B

    How can I calculate datediff between 2 records?

    Hello ccIces You could do all of the processing using a recordset and vba instead of in a query, then pass the required variables to your update query. Bryan
  2. B

    Help with date in query

    Try something like WHERE DateDiff("d",Date(),[tablename].[Renewal Date])>=0 AND DateDiff("d",Date(),[tablename].[Renewal Date)<91 Bryan
  3. B

    Trouble with INSERT INTO

    Hello csprop It looks like you are currently trying to insert the values "[TenantID].Value" etc. Not the Value contained in those items. You need to concatenate thos items into the string with quotes as appropriate Try SQL = "INSERT INTO Transactions (TenantID, Date, Amount, Category, Notes) "...
  4. B

    Extraction of first 3 characters

    Hello goldmedallist Try Select Left(YourFieldName,3) From YourTableName Bryan
  5. B

    SQL Server - Passing Parameters

    Hello stubailey007 Set the command text of an ADODB.Command object to - "exec YourProcedureName'" & Parameter1 & "','" & Parameter2 & "'" then execute the command I hope this helps
  6. B

    Unlinking tables in code

    I need to do the unlinking of tables in code and I am looking at doing this by deleting the applicable tabledefs for the linked tables. Is this the best way to go about doing it, or can anyone make suggestions on alternate ways? Bryan
  7. B

    Parameter based queries

    Hello Nick SR Parameters can be passed to queries by referencing the control on a form that holds the value required- "FORMS!YourFormName!YourControlName" The contol could be a combobox, textbox or the like. Bryan
  8. B

    Count Status

    Hello jegesmaci I would say that you may need to initialise the value in Me![Status] between calculations. Bryan
  9. B

    Force carriage return in string

    "My string " & chr(13) & "my next string"
  10. B

    Need help with a query

    Glad to be of some help. Bryan
  11. B

    VBA: Is it possible to check for a duplicate entry in a table before insert?

    Hello Argonak Do a DCount (you could also do a DLookup) on the PK value to be inserted first, if this returns 0 then the value doesn't exist. IF (DCount(newKeyCode,wire_csTBL )=0) then "Run your insert statement" Else "Do something else" END IF Bryan
  12. B

    Report Drop Down Lists

    Have the user set all selection criteria for the report on a form. Selections can be made from comboboxes bound to the applicable field of the table. Then call the report from the form. The query for the report will then nned to have it's where clause referencing the form's controls such as...
  13. B

    Need help with a query

    Hello Roonaldo Try something like this in the WHERE clause of your SELECT statement WHERE ((DateDiff("d",[HireStartDate],Date())>0)AND (DateDiff("d",[HireEndDate],Date())>0)) The section "((DateDiff("d",[HireStartDate],Date())>=0)" will give you hires that started prior to or on the date you...
  14. B

    query results

    Hello motov600 Try IIf(Left[Order_No],2)Like"OF" Bryan
  15. B

    Expanding Find Record

    Hello John11 Have you thought about using a combo box to find the surname then using combobox.value in the code for the button. The combo box could have as its rowsource as something like "SELECT DISTINCT Surname From fsubListyear7". Bryan
  16. B

    Setting properties of controls

    Original code With Me.lblGrowforControl ' the correct value is given here but the .Left property ignores it .Left = Me.txtMaxMonths.Left + (intStartMonthDiff * sngFactor) .Width = intDayDiff * sngFactor End With When I change the order of the .Left and .width lines the original record that...
  17. B

    Setting properties of controls

    In the code for a report I am setting the .Left property of a Label according to where I want it to display on the report. This is determined by the current record being written. For most records this works fine but I have 1 record for which the correct position is passed to the .left property...
  18. B

    Combo Box Value into a Label

    Hello smirnoff The value from the combo box should be able to be concatenated into a string directly to the label or by doing the concatenation into a string variable first and then displaying it. Me.lblProd.Caption="First Part of string " & Me.cboWeightCheck.value & " third part of string"...
  19. B

    Using Parameter for IN Keyword Query

    Hello HeyItsManny I may be wrong but if this is in code perhaps you need to concatenate the parameter into the statement string such as "WHERE (((user.userID) In ([" & ParameterName & "]))) " Bryan
  20. B

    populating combo box with last 5 entries

    Hello lgw002 Second question first. To read the records in reverse order use the "Sort Decending" clause on the appropriate field(s) in your query. To display the items selected in the combo box you I would probably just set the RowSource of the combo box to the query name and run the requery...
Top Bottom