Search results

  1. A

    Counting Combo box Value

    You'll need something like this as the ControlSource property for the text box showing the running total: =Nz(DCount("MyField", "MyTable", "IDNumber = " & Forms!Main!txtIDNumber & " And MyField = '" & Me!cboMyField & "'"), 0) This example assumes that IDNumber is numeric, and that both...
  2. A

    Decimals on a Report

    On the report, change the text box's Format property to Fixed. That, along with setting the DecimalPlaces property to 0, will suppress the decimal point and everything to the right of it - setting only one of these properties is not sufficient.
  3. A

    Weird DCount problem

    WIAEnrollmentsDetailQ1 is a select query, which contains a calculated String field named GrantGrp. The query works as intended as the RecordSource for several detail reports, and when opened directly from the user interface. It is also the RecordSource for a summary report, which is intended...
  4. A

    Data Validation

    Thanks for pointing out what I overlooked, Pat: this was a numeric field we were talking about, and so it cannot store an "X". However, the last approach I suggested will work if you change the table field to Text. If you do so, you'll need to always verify that the contents are numeric...
  5. A

    problem linking on SSN fields

    But how could it be that some contain dashes and some do not. Since both fields are set to store the dashes, it would seem that ALL records in both tables would have dashes stored in these fields. OTOH, is it possible that when a record is created via VBA code, one could make an assignment...
  6. A

    Data Validation

    If the table field's ValidationRule property won't work, you can always go to the form where the users will be adding/editing records, and use the BeforeUpdate event procedure of the text box bound to the field. In that procedure, you can use the IsNumeric function to determine whether text or...
  7. A

    add new record to tables

    In the form's BeforeUpdate event procedure save the form's NewRecord property to a MODULE-LEVEL Boolean variable, e.g.: MyBooleanVariable = Me.NewRecord In the form's AfterUpdate event procedure, place a conditional structure that will execute only if the last update was a new record (as...
  8. A

    Data Validation

    To allow the entry of any number between 10 and 25, or an "X", set the field's Validation Rule property to: (= "X") Or (>= 10 And <= 25)
  9. A

    problem linking on SSN fields

    In Access 97, I have a Payees table in a one-to-many relationship with a Trans table, linked to each other on a Social Security Number field (the link is Payees.SSN --> Trans.TransSSN). Both fields are Text, FieldSize 11, InputMask "000\-00\-0000;0;_". Payees.SSN is a key field, while...
  10. A

    Filtering a subform with a listbox

    Assuming that the list box is being used only to control which records are displayed in the subform (which appears to be the case), the list box should remain unbound (i.e., nothing should be specificied for its ControlSource. The Selected property (note capitalization) is a property of each...
  11. A

    Filtering a subform with a listbox

    I'd need to see the setting for the list box's ControlSource property to analyze this further, but my hunch is that the problem lies there. If you're only using a single control to indicate which product categories are selected, this cannot work properly (unless you're using a complex...
  12. A

    Cancel Query

    You can stop a query by pressing Ctrl-Break, but this can be messy (depending on the context). You may also want to change the command button's Click event procedure, so that a MsgBox is displayed, warning the user that the query is lengthy and offerring the user several ways to respond...
  13. A

    How to avoid Error 2115

    Thanks, Rich and ghudson: I neglected to mention that part of my purpose now is to avoid requiring the users to enter "am" or "pm" when I already have logic that can derive that. Apparently, the way Microsoft has ordered their events makes this difficult or impossible to do.
  14. A

    Is this possible?

    Yes, you can, with the following limitations: The form Datum must be open in form view when the query runs, or you'll get an error. You would not use the pound signs (#) in this context. They are only used to indicate a date value when the date is specified as a literal (e.g., #2/3/03#...
  15. A

    Total Records display incorrect total

    Assuming that your ID field is an AutoNumber, this is normal behavior. Whenever you start a new record, and then abandon it without saving, the AutoNumber value that was displayed in the abandoned record is discarded. If your application requires that the actual record count always matches the...
  16. A

    stumped

    If you haven't already done so, double-check the spelling and spacing of all controls on both forms, all fields used in both forms' queries, and all fields referenced within all query criteria. Also check the ControlSource setting for all form controls, and the LinkChildFields and...
  17. A

    How to avoid Error 2115

    I need some suggestions for avoiding the dreaded 2115 Error. I have a form text box bound to a date/time field in an Access 97 table. All along, I've been using the BeforeUpdate event to ensure that the time entered in the text box is not earlier than the time entered in a previous text box -...
  18. A

    File list to text

    I'm not sure what the problem is. I'm using Access 97, and the syntax may be different for you if you're using another version. Check the help screen for the Dir function.
  19. A

    File list to text

    It may be a References problem - I'm not sure. vbDirectory is a system-defined constant, with a value of 16, so the quick-and-dirty way of resolving this would be to just change vbDirectory to 16.
  20. A

    File list to text

    If you change Dir(sPath & "*.mdb") to Dir(sPath & "*.mdb", vbDirectory) it will return sub-directory names rather than file names from the specified directory.
Back
Top Bottom