Search results

  1. 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...
  2. 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...
  3. 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...
  4. 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>" _ &...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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())"
  13. 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...
  14. 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...
  15. 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...
  16. M

    Solved Create directory if not exist and save report

    Hi All I'm creating a report for each dog which I need to save in each dog's folder eg. C:\Dogs\DogID\Documents. My code does not create the directory and I, therefore, get a run-time error '5' Invalid procedure call or argument on the following line DoCmd.OutputTo acOutputReport...
  17. M

    Solved Print reports for each day in a given period(2)

    I installed the Microsoft ActiveX Data Objects 6 Library, and it seems to be the right one. I do however have a problem with the dates, it is not selecting a date. I think it has to do with formatting. Attach is a sample of my database.
  18. M

    Solved Print reports for each day in a given period

    Hi everybody, I have two reports that I have to print all at once for each day over a six week period. I've created a temp table with all the dates, ReportDate, tblReportDates. The reports have a field called CheckListDate, which defines the date of the report. I'm not good with recordsets yet...
  19. M

    Solved Update SQL not working

    Hi there I have a form with two listboxes plus a subform. What I'm trying to achieve is to update the CouncilID field in the tblLocalities to the CouncilID selected in the subform. Because there are a few thousand records in the first table I use a SearchAsYouType Listbox to find the Locality...
  20. M

    Solved Creating individual reports and send to multiple customers via email

    Hi everyone I'm sending emails to customers selected from a listbox (Arnelgp was so kind to help me with this one 😉) I have two reports to create for each customer to be attached to the individual email. Each set of reports has data specific to each customer. I've added the report creating lines...
Top Bottom