Search results

  1. S

    How to total a date field (Short Time) in a crosstab

    Hi I have a database (access 97) of training sessions which each has a date field called "Duration" (this field is in short time format HH:MM). I'm trying to and create a crosstab query which has the locations on the left and a total duration time for each month. If I try to sum the date...
  2. S

    Hiding the Filter button

    Hi This may be a no brainer, sorry in advance if it is, but I've just searched this site and the net and access help with no luck so far. I've just recently upgraded to access 2007 a few days ago and want to hide the filter button (and possibly the search field) next to the navigation buttons...
  3. S

    queries and functions

    You dont say what your 3 scenarios are or what type of fields your VAT status are, so I'll just give you a basic outline and you can tweak it. Create function like this in a module. Public Function MyResult (AppVAT as Boolean, ComVAT as Boolean) as String If AppVAT = True and ComVAT = True...
  4. S

    long sql string

    after your string is made up assuming strMySQL is your string, try Debug.Print strMySQL. Then bring up the debug window (CTRL G) and copy and paste the string into a new query (SQL mode) which may help find your problem.
  5. S

    Top Two Results

    If you bring up the properties of the query and change the top values property to 2. Don't use max, instead sort by your value (descending). Paul
  6. S

    Leading Zero Problem

    You live and learn :), handy to know that. Cheers Jon
  7. S

    Leading Zero Problem

    Try creating a public function like this below and calling it from your query:- Public Function StripZeros(MyData As String) Dim Count As Integer 'If blank then exit If Len(Nz(MyData)) = 0 Then StripZeros = MyData: Exit Function 'Scan it for characters and if found...
  8. S

    extract the price from a string

    Hi Assuming that you can't get at the Price value which you use in the caption setting (which would be far easier), you could try this:- txtTotal = cmbMultiplyer * val(mid(Me.LblCost.Caption ,instr(Me.LblCost.Caption,"£")+1) This will only work if you have a £ sign in the caption, it will...
  9. S

    sql syntax problem

    Hi In your example you are using the INSERT command which will add a new invoice to the invoice table. I'm assuming you have the invoice record already created (since you mention the invoice.treatmentname in your example) and need to transfer the cost over. You should use the UPDATE command...
  10. S

    Earliest Date

    Hi Your problem is that your txtStartDate field is not tied to any data in the back table and if it were I don't think your statement would work anyway. Try this If IsDate(nz(txtStartDate)) = False then txtStartDate = Dmin("TableDate","MyTable") This assumes "TableDate" is the name of the...
  11. S

    Field value on a report

    The error your getting is because you cannot make reference a null value. Try using NZ check it eg:- If NZ(Reports!Invoice!Item1.Value,"") = "" Then Reports!Invoice!Item1.Visible = False I suspect your other fields will not move up though once you hide this field. You may need to loop...
  12. S

    Workgroup files over Terminal Server

    I'm not quite sure why you need to do this, since you can create groups within the same security file and have multiple databases access the same security file. Also having 1 security file makes sense from a management point of view if you have to maintain users and passwords. If you really...
  13. S

    OpenArgs?

    There is nothing wrong with your code, I think the problem is with the position of your code in the frmAddZipcode form. If you try to set a control in the open event you will get an error. If you put your code in the 'On Current' event instead it should work. Private Sub Form_Current() If Not...
  14. S

    Duplex Printing acc 97

    Hi I'm trying to configure the prtDevMode to do duplex which I have got working in the MDB, but from what I've read so far (Link ) it appears you have to open the report in design view to get at these settings which I cannot do when the database is compiled into an MDE. So microsofts work...
  15. S

    Problem with form_Close() trigger

    A possibility is that your reports rowsource refers to a control on the form which is in the process of closing or perhaps there is some other reference to a control on the closing form in the saveAndOutput_Reports subroutine. If this is the case then the report may not run because it cannot...
  16. S

    Unique Random Number

    This will give you a 5 digit random number Dim iMax as Long Dim iMin as Long Dim MyNum as Long Randomize(Timer) iMax=99999 iMin = 10000 MyNum = Int((iMax - iMin + 1) * Rnd + iMin) I'm not sure if your 1st digit is part of the 5 numbers or in addition to it. If its in addition, then you can...
  17. S

    Version question

    On the code window of the new pc, try clicking tools and references and make sure you have non missing. If your using code from a dll which is not available on the newer pc then you can get errors similar to this. If there are some missing, check what other applications are installed on the...
  18. S

    Can you give combo box responses a numeric value?

    You can do this by changing your combo properties to:- RowsourceType property = Value List Rowsource = 1;Agree;2;Disagree;3;Strongly Disagree etc etc Columns = 2 Column Widths = 0 (to hide the first column on the drop down) Bound Column = 1
  19. S

    How to calculate the accumulate value of the current field

    I wouldnt store a calulated field in the database, its much better to calculate the figure when you need it in case you change any earlier figures. Try putting an unbound text box on your form and in the current event for the form put txtMyTextBox = DSum("[Oil quantity]","tblOil","RecordNumber...
  20. S

    Calculating a Date six months in advance of a Date

    There are lots of examples on this site regarding working out weekdays between dates. Probably your best route is to create a public function which accepts 2 dates and call that function from within your query, similar example is here Its always best to search the forums before posting, try...
Back
Top Bottom