Search results

  1. C

    PLEASE help...syntax error

    You can't run SQL in a field like that. What you want is to do a DLookup: Me.ScreenFieldIWant = DLookup("[Name_of_Field_I_Want]", "MYTABLE", "[SOMEFIELDTHATIHAVE]= '" & Me.ScreenFieldIhave & "')
  2. C

    Topvalues from a Form

    I have a form that displays the results of a Topvalues query. My user would like to be able to choose the number of records displayed. Is there a simple way to do this? I am running against an Access table here, no ODBC. The query and the form are pretty much plain-vanilla. If worst comes to...
  3. C

    Tricky Query . Any thoughts?

    Our fiscal calendar is in a table, also. My first thought is that you might want to include fiscal month and year in your sales record, since it would be used any period-based reporting and won't change unless the sales date changes. In any case, I'd use a Dlookup to get it...something like...
  4. C

    I Can't Tag

    The code looks good to me, although if I'm toggling the visible property, I'll also usually toggle enabled/disabled, too. This code will cycle through any & all fields in the form that have the same value in their tag. Where you put the code in your form will depend on just when you want to...
  5. C

    update query or not

    I don't know if this will help, but here goes... If I was designing this fresh, I would have three tables, Students, Projects, and Student-Project-History. The project table would contain a project ID, project description, and a begin and end date for the entire project. (Projects probably...
  6. C

    Updating Table from a Report

    Only if printing the report guarantees that the user will do something with the items on it (then you could just run an update query immediately after creating the report, not hard in code.) If there is any chance that an item (or items) would not be dealt with, then, sorry, your user will have...
  7. C

    Form Layouts

    I don't have any Access-specific sites, but a lot of the stuff that's true of Web design also applies to Access. For Example: "Colored or textured backgrounds, weirdly colored text or links, and a preoccupation with appearance over content are sure signs of a 'first generation' web site."...
  8. C

    Varible field name

    I wouldn't name fields like that, the next programmer to look at this is going to hate you. Did you know that there is a much easier way to work with groups of form fields? You can use the "Tag" property to give a set of fields a name, then modify the properties of everything with that tag...
  9. C

    update query or not

    OK, wait a minute. Each time the user enters a start date for a project, that changes the ending date for some OTHER project? Uh, that just doesn't seem right. There is no logical relationship between any two records on a table based on sequence (at least, none that you should count on.)...
  10. C

    Paramater Input?

    My hunch is that the query and the form are calling those parameters by two different names. Look at the field name in your form and write it down EXACTLY. Now, look at the query. If the field in the form that you named "fMy_Form" is XXYZZ, then the criteria in the query needs to be...
  11. C

    Save Rename

    Try this: Dim strFilename as string Dim strPath as string ' we will assume you are picking up the file name from a form strFilename = [Forms]![fMyForm]![My_File_Name] 'or me.My_File_Name, if we are in the form code strPath = "C:\Somewhere\" & strFileName & ".rtf" DoCmd.OutputTo acOutputReport...
  12. C

    Object doesn't support this property or method

    Are you using recordsets in the rest of your code? P.S. Code straight from a book, any book, rarely works without some tinkering *sigh*
  13. C

    Automate Filenames based on Parameter Specified

    Hi, 1. There are other formats available from the Outputto. Remember to change the file extension to match: acFormatASP acFormatDAP acFormatHTML acFormatIIS acFormatRTF acFormatSNP acFormatTXT acFormatXLS Sorry, never tried zipping from Access, maybe someone else has. Are you sure that you...
  14. C

    Identifying the subprocedure that called a function

    There may be a slicker way, but either of these should work: 1. Make the first parameter of the function the name of the calling routine. Then, calling modules will have to pass their name in... 2. Declare a global variable. I usually put these in a module with a catchy name like...
  15. C

    1 Form, 2 Queries???

    Following Fornation's idea, then add a button called "Show All Records", with the code: ' blank out the dates on the form Me.Month = Null Me.Year = Null ' show everything DoCmd.ShowAllRecords
  16. C

    Query -> Report (help!)

    The error sub is not fancy: WriteaPT_Error: Debug.Print Err.Number If Err.Number = 3021 Then strMsg = "Your Query did not find any records. Please review your criteria!" strStyle = vbOKOnly + vbInformation strResponse = MsgBox(strMsg, strStyle, "No Data Available") Err.Clear...
  17. C

    query to find records

    Look up "like" in access help.
  18. C

    Lots of Queries and Forms

    Yes, vickster_h, there's an easier way. First, I'd be concerned about the design of your tables. In general, using yes/no fields for something like a category or an area means that you've got some problems in the database design. Get help from a DBA-type person if you can, or find a good...
  19. C

    Automate Filenames based on Parameter Specified

    Didn't mean to be flip. This is not going to be lightweight code, but if you can pull it together, it will be very useful and flexible. The following code is completely untested and highly suspect, but it might give you an idea as to the structure that I intended. There is also a very full...
  20. C

    Automate Filenames based on Parameter Specified

    Why don't you build yourself a table to contain some of this stuff? It could have 3 fields: the constant part of the path name (not including the week number), the query that is run to create it, and the email address to be notified. Then, you write some code... First, you have your code...
Back
Top Bottom