Search results

  1. D

    dynamic query

    If you're displaying a subform on a main form, the field names of the subform won't change unless you change them, but referencing the fields on the subform with code running in the main form most certainly will. To reference the subform controls from the main form, you must use the form...
  2. D

    Is "where If" Possible

    SELECT * FROM [Table Name] WHERE ( IF ([Forms]![Form Name]![Text Box1].Value is null) THEN WHERE ([Table Name].[ID]=[Forms]![Form Name]![Text Box1].Value ELSE WHERE ([Table Name].[ID]=[Forms]![Form Name]![Text Box2].Value ); Try copying/pasting this into...
  3. D

    Finding data w/ more than 2 decimals

    Nope... ? Int(168.001*100) > 168.001 * 100 False ? Int(168.01*100) < 168.01 * 100 True ...
  4. D

    Finding data w/ more than 2 decimals

    Heh!! Try: WHERE InStr(1,[MyTable].[MyNumber] * 100, ".") > 0 (too many trees in the way of the forest...)
  5. D

    Finding data w/ more than 2 decimals

    How about: WHERE Len([MyTable]![MyNumber]) - InStr(1, [MyTable].[MyNumber], ".") > 2 which should have the exact same result as the solution Samoan posted. Neither solution takes into account if the number doesn't have a decimal point to begin with: Both will return true if the MyNumber...
  6. D

    Open a form without any data in it

    Then you'll need to set the control sources for your text boxes programatically as when you set the record source for the form. Set the Visible property for all sections of the form to yes. Set the form record source to "" (blank). Then set the Control Source for each text box to "" (blank)...
  7. D

    Find whole word matches in two strings?

    You might modify your code along these lines to improve the functions speed: Function CompareWords() Dim strInput1 as String, strInput2 as String Dim strOutput1(64) as String, strOutput2(64) as String Dim strTemp as String Dim lngPointer as Long Dim X as Integer, Y as Integer Dim I as Integer...
  8. D

    Open a form without any data in it

    The combo boxes at the top of the form should be unbound. Move those combo boxes to the form header. Your text boxes displaying the record fields should be in the detail section of the form. Set the form Record Source property to "" (blank - no record source). Set the form Navigation Buttons...
  9. D

    Parse Data

    If the last 5 characters in your field are always numeric characters, use the Len function: Format((Right([MyField],5)-1),"00000") for the last 5 numeric characters - 1; Left([MyField],Len([MyField])-5) for the charaters before the last five charaters in the string; [MyField] & " " &...
  10. D

    Move current record in a continuous form

    Here's the code I wrote to simulate something along the lines of what you were doing: Function fncFields Dim dbs as Database Dim rst1, rst2 as Recordset Dim I as Integer Set dbs = CurrentDb Set rst1 = dbs.OpenRecordset("BatMod", dbOpenSnapShot) Set rst2 = dbs.OpenRecordset("Temp1"...
  11. D

    Move current record in a continuous form

    If you don't mind my asking, why are you trying to move records from one table to another identical - except for the table name- table? At least that's what it seems you're trying to do: If the Active, Inactive, Win, and Loss tables aren't identical except in name, it's very easy to have...
  12. D

    Multi select list box

    Do you really have to mess with the querydefs collection? How 'bout this: Put another text box (txtNew) on the form that'll be hidden later (after testing). Change the click event code to: Private Sub Command4_Click() Dim strCriteria As String Dim ctl As Control Dim Itm As Variant ' Build...
  13. D

    Criteria Question

    That should have returned all records when either form field is empty. Do you have any other criteria in the query?
  14. D

    Criteria Question

    Try: Like [Forms]![ScaleLogSpreadsheet]![ComboName]&"*" Like [Forms]![ScaleLogSpreadsheet]![ComboBatch]&"*" Each of these criteria statements should go under seperate columns in the query design grid while staying on the same horizontal "Criteria:" row.
  15. D

    Multiple Form Instances in an Array

    After playing around with multiple instances of the same form for a couple of days now, Set gf_form(gint_formCount) = New Form_F_Debrief does create a new form in the forms collection; it's just not visible. So instead of: DoCmd.OpenForm gf_form(gint_formCount).Name, , , "[IncidentNo]=" &...
  16. D

    Name Splitter Problem

    Long time, indeed! And if you're not using A2k or better: Function PrsIntls(NameAgs As String) As String Dim SpPntr As Integer Dim Intls As String NameAgs = LTrim(NameAgs) SpPntr = InStr(1, NameAgs, " ") If SpPntr = 3 Then PrsIntls = Left(NameAgs, 2) Exit Function End If Intls =...
  17. D

    Form as Message Box - Button Pressed

    I've often wondered about this but could not work out how to stop the code. Ya! This was the first time I'd actually tried it myself; works pretty good... I wanted to take it one step further: have a dialog box appear during a query's execution where the query calls a custom function that...
  18. D

    Removing zero's from a column using an expression?

    Expr1: IIf(IsNumeric(Left([tblword],1)),Val([tblword]),[tblword])
  19. D

    Can noone do this? Pass a value to a subform???

    Did you try: Forms("frmUserPipeline")("subfrm_Pipeline").Form("DateRouted") = Calendar
  20. D

    Form as Message Box - Button Pressed

    Just to verify my own thought process on this topic, what you're doing is opening the form you want as your dialog box using acDialog as the Window Mode for in the DoCmd.OpenForm method, like: DoCmd.OpenForm "frmMyDialog", acNormal, , , , acDialog That suspends code execution in the module...
Back
Top Bottom