Recent content by TedMartin

  1. T

    Overflow

    I have some code that is puzzling me. Dim iCycle as Long Dim iStep as Integer iStep = 10 more code ... If iCycle >= 10 * 60 * 1000 / iStep then 'Do something end if I get a Error 6 overflow on the IF line of code. If iCycle >= 10 * 60 * (1000 / iStep) then I don't understand as 10*60*1000...
  2. T

    Macro to Export a Field and Find/Modify a Template

    The best way to send an eMail using data is to use the Outlook Object. I have just posted the code in the modules section of this site. Take a look there. You can then adapt the code or even use a recordset (table) to add the relevant data to your eMail.
  3. T

    Summing records in a query that have the same values in 2 columns

    Have you tried using the Totals button in your query? This may be the simplest solution. If it isn't then maybe you need to run a Make Table query and then query that for the totals.
  4. T

    Sending email to one user

    Here is the code anyway BUT make sure you check in Module/Tools/References the Microsoft Outlook Object Library. Private Sub Command0_Click() On Error GoTo Err_Send Dim objOutlook As Outlook.Application Dim objeMail As Outlook.MailItem Set objOutlook = CreateObject("Outlook.Application")...
  5. T

    Sending email to one user

    Before I send you all the code you need; one quick question. Do you just need to create an eMail with the address of the person on your form already filled in so that the subject and body can be completed manually? If so, then the this simple button code would suffice, where eMail.value if the...
  6. T

    Doevents vs a timed Pause

    Thanks - sorry to be a pain but just to make sure I get it right; if I want a Sub to complete before continuing, then I code as follows Doevents Call mySub .... rather than putting the Doevents as the first line in the sub. thanks
  7. T

    Refresh a SubForm

    A genius beyond your years. Thanks very much.
  8. T

    Refresh a SubForm

    I have the following code that in itself works fine. If CurrentProject.AllForms(myForm).IsLoaded = True Then Forms![F-Enquiry].[SF-Actions].Form.Requery ' *** this is the problem line End If BUT in the line marked *** I need to replace the form name F-Enquiry with a variable name [myForm]...
  9. T

    refreshing forms

    This may be a bit clumsy but remember the record number and close the form and re-open it filtered to the right record. It will cause the screen to flash but assuming the db is not massive, it should only be a spilt second. Someone else may have a more classic solution but time is time so this...
  10. T

    refreshing forms

    Docmd.requery should do it but the key is When? If one of your Modal Pop-Ups was a Dialog box, then when the Pop-Up is called from the Main Form, the code will interrupt until the process returns. This could be the point when you want the Requery to happen. Failing that, flag it in some way...
  11. T

    Toggle Box and Queries

    I think I understand. Sound like you need another field on your table that is called DataEdited". It is a simple Yes/No that when edited the value is changed to Yes, which is -1) Add this field to your form, make it Locked but remaining ENABLED and when the Edit Button is pressed, the code...
  12. T

    Automatically change default value

    Are you accessing the raw directly in the table or via a form. Changing the default value in a form via an IF statement code would be straightforward.
  13. T

    Finding the sum of the values in a field.

    Sounds like you need to Create a second query based on the first one and then sum the Total 1 field in the second query
  14. T

    edit button for tabular view

    On the forms Close event and On Current event, you need to Lock the fields. Just as a precaution, you could also set the field's Locked Propety to False. Obviously you will need to Un-lock them for a New Record. This can be achieved by having a menu or button command that is Add New Record...
  15. T

    Stoping Macro on last record

    Post your code here and we shall see.
Back
Top Bottom