Search results

  1. L

    error in function when field is null

    Hi I am trying to create the below function. I managed to bring the correct result, however, the field EDF, might contain data or zero or empty. While with data or zero, i get the result i want, when empty, the function returns error. Is there any way i could work it around ? Public Function...
  2. L

    DoCmd.sendobject method, customize the attachment file name

    Hi With DoCmd.SendObject methode, we can send reports as email attachments. Could we customize the attached file name ? My report is tuned to filter on load [Forms]![FormName]![FieldName] With the below line, the report on email attachment gets always the same name, the report name (or report...
  3. L

    Retrieve excel from access (vol 4) , extended format , alternative color

    This is a VBA script from which i export data from access database to an excel. The excel looks like this and may contain 2000 or more lines. I have removed several lines from the code, those lines that format and calculate, just to make it shorter. My "goal" now is to apply an alternative...
  4. L

    Lock record

    The below code, performs the required action, If i click on the yes/no field 'lockrec', the record gets locked, however, if i close and reopen the form, then form edit is allowed. How could i make it so the record remains locked. Private Sub LockRec_Click() If Me.lockrec = True Then...
  5. L

    Adjust text in outlook email body

    Long story sort, I have created an access application in which i update a form, then i extract an excel that is exactly how it should be, i send this excel file as attached email, then i copy paste the whole excel form and paste on email body The problem is this, once i paste it, the text...
  6. L

    VBA- Export from access to excel, autofit rows

    Hi When we extract from access a report to excel (see my previous topic https://www.access-programmers.co.uk/forums/threads/extract-excel-from-access.324274/#post-1838727) we can format various fields When we want to fix the width of a column we have .Columns("A:A").EntireColumn.AutoFit...
  7. L

    Access Application for Guitar training - CHALLENGE

    Hi I am learning to play the guitar. There is one exercise. I must memorize , in each guitar position (12 fret by 6 strings = 72 positions), which note is. To do so, i need a metronome, one tik every 4 seconds for example and someone to tell me randomly one note, for example "D#" or...
  8. L

    Shell function to open a specific word document

    Hi I need to open a specific word document from a form. I have created a command button with the below bit of code but i get run time error 53 , file not found When i repeat same function using notepad.exe , then the txt file opens without error. Private Sub Command67_Click()...
  9. L

    Solved If then else statement with "AND"

    Hi I use this beat of code and returns the results i wish. If country - "China" then msgbox = "something" elseif country = " Japan" then msgbox = "something else" else msgbox = "something more" Endif I would like to add the "and" and make the code as below but the syntax is not...
  10. L

    Corrupted database

    Hi there My database crashed, doesn't open anymore. I get the error "id is not an index in this table" Then i continue on the back up, i lost no data but i am afraid . that the backup database, has inherited all the "errors" from the original one Is there any way i could find out and fix the...
  11. L

    OUTLOOK ACCOUNT // access docmd send object method

    Hi , in my outlook account, i host two email address. The personal and the business. When i use the docmd.send object method from ms access, then the outlook captures as default email sender the personal email address, then i must change the sender to business email manually. Do you happen to...
  12. L

    SQL converter

    Hi everyone I have found and created the below code in which we can convert an sql statement to VBA. I have added my owb line which i just want to replace the ' ' S = Replace(S, "'", """") Now, the question is , if we have a very very long sql statement, how could we break it into...
  13. L

    Export data from Access to Word with VBA

    Hi there, with the code i display below, we can export data from access to excel by using VBA. In this link, someone can find the sample database. https://www.access-programmers.co.uk/forums/threads/extract-excel-from-access.324274/ I need to do the same with MS Word. I need to export data from...
  14. L

    Solved Extract excel from access

    @arnelgp This is a new thread, continued from this one https://www.access-programmers.co.uk/forums/threads/format-multiple-currencies-based-on-a-value.324037/ but since subject has changed, i open this new here. With the below code, we can retrieve from access tables, one report in excel. One...
  15. L

    Autofeed field in subform based on combobox from parent form.

    Hi In the example, one simple form-subform one to many I would like, once i update the combobox on form, to auto fill the field fld2 in subform. I can link parent to child but i don't want this method because i may need to change the combo to another value and then all records on subform will...
  16. L

    Solved Error number :91 = Object variable or With variable not set

    Hi I get this error when i try to play with this code Error number :91 = Object variable or With variable not set The purpose, one very simple table consisted of four fields, i just want to get these fields exported in an excel sheet. Private Sub Btn1_Click() On Error GoTo SubError...
  17. L

    Solved Format multiple currencies based on a value

    Hi In one excel report that I extract from access database, I have two columns which outline mixed currencies, usd or eur. Before, in the old report, the format was just currency “none” and I had used the below line, it worked just fine. .Range("M4", "N" & i).NumberFormat =...
  18. L

    Replace Chr(9)

    Hi, In one form, I have a long text field, named text2. I copy and paste in the field text2 details in bulk, then very easily i update other fields in the same form. The problem is that the data source contains "tabs", CHR(9) I need to make one "before update event" which will kill all the...
  19. L

    Subform to display records based on form combobox

    Hi This is about making offers to customers (shipping, dealing with freight) I have two linked tables/form.subform, which i use for creating offers to my clients. In the form, there is combo box from which i chose the area, for example LATAM (= Latin America) or FET (far east) or TAT (trans...
  20. L

    increment number set up by new record per client

    MyCounter = Nz(DMax("MyCounter", "CustomerT")) + 1 Hi With the above line on BeforeInsert event, we can create our own record counter. For example "invoice number" on each invoice or "quotation number" for each sales offer we send to our cliants. The problem is that then, our client, can see...
Top Bottom