Search results

  1. C

    Sorting on forms?

    Here are two options. Either base your report on a query, and sort the records there, or use the "orderby" option on the form properties.
  2. C

    adding records from one field

    Don't store the results of a calculation in a field. It's bad database design and will almost always get you into trouble. The way around this is to create a summary query that contains this info. You can then use this query as the source for reports or forms. The user will never know the...
  3. C

    coding "enter"

    I agree, you should check for all your required info. My guess is that you are not closing the first form, therefore changes don't get written. Code like this will let the user back out of an incomplete form: If Me.Dirty Then If MsgBox("Do you wish to save changes?", vbYesNo +...
  4. C

    Report format in Excel

    Try this link to Dev Ashish's site, and an article called "Transferring Records to Excel with Automation: http://www.mvps.org/access/modules/mdl0035.htm This method is some work, but once it's set up, it gives you a lot of control over the Excel formatting, and it runs fast.
  5. C

    Button on form to print report for THAT record

    You need to change the query that your report is based on, so that instead of asking for the patient account, it looks at the account field on the form. (The criteria would look something like this: [Forms]![fMyForm]![txtPatient_Acct]) Now, when you test that query and/or report, you'll need...
  6. C

    I just can't work it out

    I know someone will come up with a sleeker solution than this, but off the top of my head, I'd write a query with four additional fields, like this (code is approximate): Score1:Iif([Mytable]![Score] = 1,1,0) Score2:Iif([Mytable]![Score] = 2,1,0), etc (for 3 and 4) Then you can write a second...
  7. C

    Hi!... Can you alter query criteria through code?

    If you are using Access tables, you can simply set up a parameter query to do this. For linked tables, you'll need to actually modify the query itself in code. Look up the Microsoft Knowledge Base article Q131534.
  8. C

    unselected fields showing in query

    What's the underlying database? Can you post your query?
  9. C

    Using a Form to Open Custom Report

    I guess I usually use a little different approach, maybe no better. I set up a little field, called "strFirstWhere", and initially set to "Y". My basic SQL would not have the "WHERE" in it, because maybe the user wouldn't specify any criteria at all. Then my logic would be roughly like this...
  10. C

    Using a Form to Open Custom Report

    This is a good time for you to get familiar with the debugger, if you haven't used it already. Put a breakpoint in your code, before you do the openreport, and look at the values of mySQL and your form fields I'd also change your code from: If Nz(Forms!frmnewrpt!txtLastName) <> "" Then to...
  11. C

    I need help in planning forms and linking tables

    Let me just comment on a little part. If you have standard costs for an item, then you will need a table to store those costs. I would make sure that any costs that you store have effectivity dates on each record (possibly the beginning date and certainly the ending date that a particular cost...
  12. C

    exporting data to excel files

    I'm using Access 2000, so this may not help, but do you have a reference to the Microsoft Excel 9.0 object library?
  13. C

    Report formatting (Landscape)

    I think that the "Name AutoCorrect" problem could safely be called a "bug"... To turn work with it in code, use Application.SetOption: Public varTrackSetting as Variant Public varPerformSetting As Variant Public varLogSetting As Variant Public strTrackAC As String = "Track name AutoCorrect...
  14. C

    Problem wit SQL-Statement

    I would put the "like" into a where clause in your SQL statement. That way, you only will select the correct records in the first place. This code is off the top of my head and you may need to correct the quotes: Dim strSQL as String ... strSQL = "SELECT * FROM tblNaam WHERE naam like '*" &...
  15. C

    Margins problem

    Are you absolutely, positively sure that the name autocorrect feature is turned off in this Access database, and that you haven't accidently turned it back on?
  16. C

    Records-selected

    What are "TOP25", "TOP15", etc? Are they tables, queries, or are you trying to do an Access "top values" query? Can I assume that you are running one report, based upon one query, and that query references the content of your combobox?
  17. C

    Fill textbox with result from query

    Let me just clear up one thing. If you did decide to base your form on a query, you don't need to start over, at all. If the query contains at least the same fields your using in the form (and maybe more), then all you do is change the "record source" property for your form from the table...
  18. C

    Multiple joins

    Can you post the SQL for your entire Access query?
  19. C

    Multiple joins

    I don't know what my own record is for multiple joins within a query...but it's a lot more than two! What is the error you are getting.
  20. C

    Export CSV to variable location

    I'd put a text box on the form where users can key in the location. I would do some editting in the after update of this field, so that you're sure it is reasonable. The user would not specify the file extension. Then I'd have code like this on the export button. I am not familiar with .CSV...
Back
Top Bottom