Search results

  1. F

    Compile error: end if without block if

    Easiest way Make a query with the fields you need to export (ProjectName, ProjectDetail,ProjectEnd, CharlesRole, txtboxcolumn) and filter the values where txtboxcolum = true Add these code (untested) Dim rst as DAO.recorset set rst = Currentdb.openrecordset("qryname") do until...
  2. F

    Compile error: end if without block if

    Your form is based on a query. You mean the data on the form is a continous form with for every record a checkbox wich can be checked to be exported or not? The best way todo this is ,because your checkbox is bounded, that you make an recordset based on the table of the values where the...
  3. F

    Compile error: end if without block if

    Place end with before end if
  4. F

    Checking the last record in a loop over a Recordset

    Try this one. For dlookup values you can use Nz function so if it not finds a value it will return 0. Do While Not rs.EOF 'Get the date from this year yearr = rs!Id_jaar hours_followed_valid = DCount("uren", "dbo_Lan_opleiding", "Id_landmeter ='" & landmeterID & "' and...
  5. F

    Checking the last record in a loop over a Recordset

    If (hours_followed_valid > 0) Then hours_followed = DSum("uren", "dbo_Lan_opleiding", "Id_landmeter ='" & landmeterID & "' and Year(datumopleiding) = " & yearr & "") Else hours_followed = 0 End If Because the next years hours_followed_valid = 0 and you not set...
  6. F

    Checking the last record in a loop over a Recordset

    can you place the adjusted code?
  7. F

    Checking the last record in a loop over a Recordset

    Are the values who worked before also messed up? What's the difference with before? Put debug.print hours_followed_valid after the hours_followed_valid = Dcount line. This will display in de DIRECT display of VBA wich values he gets when running thru your recordset so you can see if it...
  8. F

    Checking the last record in a loop over a Recordset

    don't think so because the error is invalid use of Null so the error is in the DSUM function. you check it before you calculate , try hours_followed_Valid= DCOUNT("uren", "dbo_Lan_opleiding", "Id_landmeter ='" & landmeterID & "' and Year(datumopleiding) = " & yearr & "") if...
  9. F

    Checking the last record in a loop over a Recordset

    just said you get the error at hours_followed = DSum("uren", "dbo_Lan_opleiding", "Id_landmeter ='" & landmeterID & "' and Year(datumopleiding) = " & yearr & "") so if there is no data it can be 0 because they didn't follow some yet? Right? Try this one, if it returns Null it will take the 0...
  10. F

    Checking the last record in a loop over a Recordset

    Jaar = year(Me.startdatumTxt) SQL = "Select Id_jaar from dbo_Lan_verplichtejaaropleiding where Id_landmeter = '" & landmeterID & "' and Id_jaar >=" & Jaar & " order by Id_jaar asc" Set rs = CurrentDb.OpenRecordset(SQL) Can you change your SQL so it not get year 2016 because there are no...
  11. F

    Checking the last record in a loop over a Recordset

    What error it gave? What is the value of it when you go over it with the mouse i debug mode? Can you upload a stripped down version of your DB so can see at it?
  12. F

    Checking the last record in a loop over a Recordset

    try this Do Until rs.EOF If (Nz(rs!Id_jaar, 0) = 0) Then 'do something Else yearr = rs!Id_jaar
  13. F

    Checking the last record in a loop over a Recordset

    I changed the code little bit because first i think you asked to read out last record. If i'm right you want to add some other parameters when it is the last record and otherwise the values of the recordset. I see that you have problems with null values. Beter see function NZ. With this...
  14. F

    Checking the last record in a loop over a Recordset

    Rs.movelast brings you to the last record.
  15. F

    Linking Access to word to enter information into template

    Save the (.saveas function after filling in the fields) file to a location and then attach it to your mail.
  16. F

    Linking Access to word to enter information into template

    Do you use office 2013? I had also little bit problems to get it working. Here is the code wich works for me in word 2013. I had to use an old form control in word instead of the normal one to let it work. See pic to show wich i mean Private Sub Knop0_Click() Dim appWord As Object Dim doc...
  17. F

    Linking Access to word to enter information into template

    Activate your word references. Go to VBA editor extra -> references check Microsoft Word xx.x object library I also would change to On error Goto errhandler. I did oversee that you have an error handler in your code Private Sub Knop0_Click() Dim appWord As Word.Application Dim doc As...
  18. F

    Linking Access to word to enter information into template

    Try to change Dim appWord As msWord.Application Err.Clear to Dim appWord as Word.Application Error.clear Also comment out (') On Error resume next and Error.Clear so Then you get popup when it goes to error where you can click debug and the line wich is then highlighted...
  19. F

    Layout subform

    That i know u have to do. I'm talking about layout. I would like to split up order in 3 categories and showned like that but also like ro keep the orde together. That i.do know with creating new table to get the structure.
  20. F

    Layout subform

    A good friend of me is starting his on business in french frites. I said i will make him a DB. Because they always work with 2, 1 who makes the french frites and 1 the meat it will be more easy the orders split up in 3 categories (1 extra for drinks and sauces) I attached a test DB i...
Back
Top Bottom