Search results

  1. C

    IIf

    If you are sure that the first character of the text field is a 2, something like this should work: Iif(Left$([AcctCharged])="2","44","45") If you are looking for the 2 somewhere else in the string, check out the Mid$ function.
  2. C

    chart report based on months

    Create a query that will pick up the beginning and ending month parameters from your form & select all of the data that should be on the chart. Then base the chart on that query.
  3. C

    Or What?

    You need to make sure that your criteria are "OR"d. Let's say that you have 3 text boxes on your form (txtField1, txtField2, txtField). You'll need three criteria rows in your query, in the column for Field. The first will look like: [Forms]![fMyFormName]![txtField1] and the second will be...
  4. C

    Calling Field Values

    Instead of checking if the fields are null, sometimes it's better to use the LEN function and check if the length is equal to 0.
  5. C

    Having one field be one thing, depending on the field of another.

    I would code it into a function, using Case, and call that from the query.
  6. C

    Report Based on Form?

    If you are using Access tables, this is pretty simple. You create a query that picks up its criteria from the form. In the "Criteria" row in query design view, you'll have something like this: =[Forms]![fMyForm]![Report_date] Where fMyForm is the form, and Report_date is some field on that...
  7. C

    report based on months

    OK, You can have two comboboxes, one with the beginning month and one with the ending month. What you need to do is to create a new field in your query that will pull out just the month from the date in your table. Then you use between in the criteria for this field.
  8. C

    Open a Report Programmatically

    1. Like this: Dim stDocName As String stDocName = "rMy_Report_Name" DoCmd.OpenReport stDocName, acNormal 2. Assuming that you've created and saved your query, open up the Properties for your record, and put the name of your query in "Record Source". Are you trying to write a...
  9. C

    Previous Record

    At the risk of sounding like a broken record, do NOT store balances in records. Recalculate them when you need them.
  10. C

    A Hotkey for Moving from a Datasheet to a Single Record form

    Here's maybe half of what you need. I'm not sure about the hot key, but opening the form from somewhere shouldn't be a problem. I have users double-click in first field of the record they want to see. Then, I run the following code in the "on dbl click" event of that field. It builds a...
  11. C

    Filtering Records

    Does a compact & repair on the database fix it?
  12. C

    error statements

    In pseudoVBA: Iif(Supply = 0,0,Sales/Supply) [This message has been edited by Chris RR (edited 10-25-2001).]
  13. C

    Need help

    Code for which option? If you want to do your groups on the fly, you would create a new field in your query. There are several ways to fill it: * In the "Field" row in your query, use an Iif, long but not impossible: GroupCode:Iif(Left$([MYFILE]![Name_Last],1) In...
  14. C

    Sort Order

    Like what, for example? It's not unusual in many systems, to build some sort of field that is used exclusively for sorting (and never seen by the user). For example, you might group left-handed, color-blind employees from Michigan as the group "A", contract employees from Iowa with red trucks...
  15. C

    Auto open form by clicking the name another form

    In the "on dbl click" property of the name, put code like this: Dim strDocName As String Dim strLinkCriteria As String 'other code might go here... 'set strDocName to the new form strDocName = "fUpdateInfo" 'set up whatever filter you need to bring up this record strLinkCriteria =...
  16. C

    Multiple Date Fields - Determine Most Recent

    Are you trying to save the value of the most recent date, or the name of the field that contains the most recent date? Are you really trying to store this value in the record (hope not, very bad idea) or use it somewhere? I'd suggest a good Oracle reference book and a chat with your DBA.
  17. C

    Moving record to another table

    See replies under your other posts. Please do not put out multiple posts on the same question.
  18. C

    Moving record to another table

    See reply under tables. Also, users on this forum strongly discourage double-posting questions.
  19. C

    Need help

    The primary key for a file can be more than one field. What if you make the first field your prefix ("1" for A, B or C, "2" for D, E, F, etc), then make the second field an Access autonumber field. (Hint: Make the autonumber more than three positions...) This will give you unique ids, but it...
Back
Top Bottom