Search results

  1. D

    Sorting text field as numeric in report? Please Help

    Try this: SrtFld:String(7 - Len(Format(Val([House/FlatNumber]))),48) & Format(Val([House/FlatNumber])) & [House/FlatNumber] Add "SrtFld" to your query and sort on that field. Note: Whats the maximum number of total characters allowed in House/FlatNumber? That's the number that should replace...
  2. D

    Best way for sorting text field as numeric?

    Looking back over the posts, I think you're missing a function call in the query. txtVal shoulld be: Mid([House/FlatNumber],IIf(Val([House/FlatNumber])=0,1,Nz(Len(Val([House/FlatNumber]))+1,1))) and not: IIf(Val([House/FlatNumber])=0,1,Nz(Len(Val([House/FlatNumber]))+1,1)) That's why txtval...
  3. D

    Best way for sorting text field as numeric?

    Why not just: SELECT Temp2.Field1 FROM Temp2 ORDER BY Val([Field1]), Temp2.Field1;
  4. D

    Weird Query Problem

    I believe you're seeing a null value propagate through your expression. Try: Items in Stock: Sum(-Nz(Newstockpart1.Quantity,0)+Nz(Items.ItemStock,0)+Nz(NewAcqPart1.Quantity,0))
  5. D

    Next Record in a subform

    Try: Forms![Processing]![Order Processing].SetFocus DoCmd.GotoRecord ,,acNext I leave it to you to check for a new record or EOF...
  6. D

    referencing subtotals fields on mainform from subform

    Is the subform control name on your main form = "MySubForm"? Yes. hth,
  7. D

    sub form woes!

    Me.subPlanetItems.SourceObject = "qryInPlanetNotInWIMS" would be used to change the form object, not the query behind the form. You need to change the Record Source of the sub form. Try this code: Dim frm as Form Set frm = Me!subPlanetItems.Form With frm frm.RecordSource =...
  8. D

    Access subform from a different form.

    Just before your code writes to the subform, try: Forms![SuppierOrderCreateNew]![subformControlName].SetFocus DoCmd.GotoRecord ,,acNewRec
  9. D

    Access subform from a different form.

    Open the mainform in design view. Click on the subform control to select it. Look in the Properties list for the name of the subform control. That's the name that needs to go in: Forms![SuppierOrderCreateNew]![subformControlName].Form![productNumber] = 10
  10. D

    Access subform from a different form.

    Is "SupplierOrderCreateNewSubForm" the name of the subform control on form "SuppierOrderCreateNew"?
  11. D

    Combining 3 textboxes

    Assuming you are not trying to call the DateDiff function in the IIF statement, while you can combine it into one statement: =IIf(IsNull([Bleh]),IIf([fldDateDiff]<7,"",IIf([fldDateDiff]<14,"7 Day Warning",IIf([fldDateDiff]<27,"14 Day Warning","28 Day Warning")))) I think a better solution is...
  12. D

    Cycle Through All ComboBoxes On A from, without using the name?

    Dim ctl As Control For Each ctl In Me.Section(acHeader).Controls If ctl.ControlType = acComboBox Then Debug.Print ctl.Name 'or do other stuff..... End If Next ctl hth,
  13. D

    Formatting the output of a query

    Have you tried setting the format property for the query field?
  14. D

    Pick the UCase letters only

    A million records? Ooof!! This may not be fast... Function fncFindUC() Dim str as String, Result as String Dim I as Integer, J as Integer, CharCode as Integer str = "{sectl}SECTION I<qa>\nPREFLIGHT (05-20-10)\" For I = 1 to Len(str) 'replace all LC characters in str with sp " " CharCode...
  15. D

    Criteria and no criteria

    Have the query the form is bound to pass the two field values to a custom function and check the return value against criteria in the query. Your form query would have a WHERE statement that looks something like: WHERE (((fncMyFunction([tblMyTable]![MyField1],[tblMyTable]![MyField2]))=True))...
  16. D

    Populate a form from a double click

    Dim rs As DAO.Recordset Set rs = Me.RecordsetClone rs.FindFirst "EmpName = " & Me.OutList & '"' Me.Bookmark = rs.Bookmark
  17. D

    IIF([Or/And/Else])

    How about this: Public Function QueryValues(ByVal VPScore As String, ByVal Spenditure As Long) As String QueryValues = "Decline" On Error GoTo Err_QueryValues If VPScore = "RB5" Then Select Case Spenditure Case Is <= 32 QueryValues = "200" End...
  18. D

    Sort Data in a combo box

    Instead of choosing a table from the drop down list in the Row Source property for the combo box in form design view, open the query builder for the combobox by clicking on (...), show your table, pick your table fields, sort according to your requirements. hth,
  19. D

    Nested IIf or module for DateCode formatting

    I would definitely use a custom function instead of nested Iif statements. Query speed not withstanding, your logic flow alone using Iif statements - while probably possible - does not at all lend itself to the next user specified change. A query formats columns, not rows. So I think you might...
  20. D

    Open a form depending on conditions

    Use the openargs argument of the DoCmd.OpenForm method to pass to the form that's being opened the form name that's doing the opening. From either the edit_product or product_enquiry forms, this goes in the on click events for the command buttons that open the search form. DoCmd.OpenForm...
Back
Top Bottom