Search results

  1. M

    Solved Update records through a recordset

    Hi there I need help, please! With the code below I add a set of records into a table tblDNAProfile. The added record have a null value in the DogID field. Next I want to update the DogID field in those records with the current DogID value. I don't get any errors and it does not update those...
  2. M

    Signature Image in GMail email body

    Hi there I'm sending bulk emails through my Gmail account. The emails are sending but does not include the signature image at the end. Can somebody help me with the right code, please? Thank you! Private Sub CmdEmailReview_Click() Dim strText As String Dim HTMLBody As String Dim i...
  3. M

    Solved Type mismatch

    Hi everyone I'm getting a run-time error 13 Type mismatch on line 60 of my vba code. I'm very confused and not sure what is causing the error. Any help will be highly appreciated. Private Sub Form_Load() ContactList.RowSource = "" Dim SearchSQL As String SearchSQL = "SELECT...
  4. M

    Solved Format Email Body

    Hi everyone I'm sending emails using the attached code. I want to format the strBody to a certain font and size. I do appreciate any help Thanks Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD .InitialFileName = "c:\"...
  5. M

    Solved Invalid Date

    Hi there I'm trying to prevent the user to enter a date in the future. If the date is greater than todays date the field should be cleared and have focus again. Somehow my code is not working. Private Sub TreatmentDate_AfterUpdate() If Me.TreatmentDate > Date Then MsgBox "Treatment...
  6. M

    Solved Invalid use of Null

    Hi everyone! I have a form which I use to allocate the puppies we have to a certain buyer. At the bottom I show the invoice, which is created in the after update of the CurrentOwner(cboBuyer) combobox. The InvoiceID is linked to the OwnerID and also have a field for the DogID which is stored in...
  7. M

    Solved Object variable or With block variable not set Error

    I get an "Object variable or With block not set" error on the following code. I did a Debug Compile and it compiled without any errors. What could be the problem? Dim rs As DAO.Recordset Set rs = db.OpenRecordset("SELECT Count([pkFilename]) AS RecCount FROM TblDocument...
  8. M

    Solved Openargs value in select statement

    Hi everyone I want to open a form a subform based on a value assigned to openargs. The new form have a listbox with a select statement to filter the records based on the openargs value. The field value to pass is BirthDdate. SELECT qryDogs3.DogID, qryDogs3.[Puppy Name], qryDogs3.BirthDate...
  9. M

    Hyperlink in Email

    Hi there I'm including a hyperlink in an email. How can I get it to show as a hyperlink once the email is generated? Thank you in advance! strBody = "Dear " & Forms!frmContactEmails!ContactList.Column(1, i) & "<br><br>" _ & "Please follow the link below" & "<br><br>" _ &...
  10. M

    Solved Dlookup null value

    Hi there I have a Dlookup to get the value of the CurrentInvoiceID but it returns with a Type Mismatch error. All the fields are numeric and CurrentInvoiceID and CurrentContactID have been declared as long. I also need to add NZ() for null values. Any help is highly appreciated. Thanks...
  11. M

    Solved Runtime Error with CurrentDB.Execute Update

    I get this error when I run the code below and can't figure out what the problem is. Any help would be much appreciated! Thanks If ContactInv > 0 And Payment > 0 And DogInv = 0 Then CurrentDb.Execute "UPDATE tblInvoices SET DogID = CurrentDogID" _ & " WHERE...
  12. M

    Solved Syntex Error

    I'm getting a run-time error on this code and I think I'm missing a bracket. Can someone please help me? Thank you!! Sub Search() Dim tempCriteriaForReport As TempVar Dim strSearch, strCriteria, strGender, strColour As String Dim task As String Dim varItem As Variant If...
  13. M

    Solved Access to Excel link

    Hi there I have this procedure which selects date and write it to two tables. Lower down I do a xlBook.RefreshAll. The data from these two tables should then be imported into the Excel file. This is followed by a DoEvent and I then run the Excel macro from this procedure. All my code compiled...
  14. M

    Solved Recordset

    I want to select data from tblMedicalRecords which match a certain critera and write them to a table called tblWeights. Below is an example of what the SQL query would look like. The records from the table tblDogs have to match the value that is in field ReproductionID with the value in...
  15. M

    Solved DLookup Error

    Hi guys I get a Data type mismatch in criteria expression error in my Dlookup expression. When I add a Toggle Breakpoint and step over each line all the values are there and correct. The Dlookup picks up the Motherid but not the Litternumber. I just can't see what I'm doing wrong...
  16. M

    Solved Syntax error in query expression

    I have a combobox in my form with a list of all my contacts as rowsource. I don't get any error when I select a name from the list. I also have an after update event and does exactly what it's supposed to do. When I delete a name from the combobox and leave it empty I get this error: Syntax...
  17. M

    Solved Insert Into SQL statement

    Hi I'm getting a Syntax error in the RunSQL statement. It must be something to do with the date because it works fine when I leave it out. I did a compile with no errors. DoCmd.RunSQL "INSERT INTO tblDogsChecklist (ContactID, DogID, InfoEmail) " & _ " VALUES ContactID, DogID, (date())"
  18. M

    Solved SELECT Statement

    I assume something is wrong with my second Where condition in the Select Statement. It works when I run it with only the first Where condition. Can someone help me with this, please? Private Sub Price_AfterUpdate() On Error GoTo ErrorHandler If Me.CboBuyer > 0 Then Dim CurrentPrice As...
  19. M

    Solved DLookup

    Hi there I have a continuous form, frmBuyerDetails with a list of Contacts and a subform called frmInvoice. The forms are linked as follows: Link Master Fields: CurrentOwnerID (tblContacts) Link Child Fields: ContactID (tblInvoices) In the After Update Event of the combobox on the main form...
  20. M

    Solved Save Report to PDF VBA, not saving last part of report

    Hi all I'm running a report consisting of up to 10 pages from VBA. All pages are printing correctly with the DoCmd.OpenReport, however, leaves the last section of the report out when it exports the report to pdf. I've added a pause in between with no luck. Does anyone know why this is...
Back
Top Bottom