Search results

  1. P

    combining dates in query

    I'm not sure I understand your requirements correct but try this SQL. SELECT Tabel1.user_id, Tabel1.code_id, Tabel1.datum, Tabel1_1.ref_date, Tabel1_1.ref_explication, Tabel1_1.ref_date FROM Tabel1 LEFT JOIN Tabel1 AS Tabel1_1 ON (Tabel1.datum = Tabel1_1.ref_date) AND (Tabel1.user_id =...
  2. P

    Autonumber problem. (with sample file)

    With this code, editing a record would also change the number, you should check for new record like: Private Sub Item_BeforeUpdate(Cancel As Integer) If Me.NewRecord Then Me.Line = nz(DMax("[Line]", "Detail", "[Reference] = '" & Me.Reference & "'"),0) + 1 End If End sub
  3. P

    Help with a bound Combobox - One change in Combobox changes another combobox

    Both combo's are bound to the same field (SapId) so you get the behaviour you describe. Bind cboRemOfficer to [Remuneration Officer] and problem solved. One note to your table tblOverpayments, why store all the info that is in table tblPersonnel. You can easily look it up and have no duplicate...
  4. P

    Validation Rules with Multiple Criterias

    Between does not work wit or as victorsales discovered, there's no reference for between in the help. This works with an or. (>10000 And <19999) Or (>80000 And <89999)
  5. P

    Printing to multiple PDF files

    You need to filter your report in preview, then save your PDF and close the report, like: Do Until .EOF = True DoCmd.OpenReport "toner", acPreview, , "ID =" & rs!ID DoCmd.OutputTo acOutputReport, "toner", acFormatPDF, cesta & kod & rs!ID & ".pdf", True...
  6. P

    Shell Fiunction Not Working Properly

    You're passing the 3 as a parameter to WlMail. The correct way would be to leave the 3 out of the MyPath variable and call it like: Shell MyPath, vbMaximizedFocus The access constant vbMaximizedFocus = 3, I prefer using the constants as it makes it easier to read the code.
  7. P

    SMTP Maximum Per Send

    By default a SMTP server is limited to 100 recipients (M$ claims it can do up to 300), this to prevent dictionary attacks. The available memory on the server can limit the number of recipients if the mail adresses are long strings.
  8. P

    Strange Union Query Error

    I agree with Galaxiom about normalistation. The first query for a union defines the order and column names. Your second query has a different order then the first so you end up with the wrong result.
  9. P

    How to check for already existing records

    Use Dcont to check if the combination is already present like: If Dcount("*", "Resultaat", "studentindex = " & studentindex " and toetscode = " & opleidingid ) > 0 then msgbox "This record already exists" else ...your Sql code End if
  10. P

    Run-time error 3061 - Recordsets

    Your query references a form in the where clause, the reason for your error. Ýou can't use a query that uses form lookups from VBA instead create your query on the fly like: Dim strSQL as String strSQL = “SELECT TBL_Accession.AccessionID, TBL_Accession.FirstAccNo FROM TBL_Accession " & _...
  11. P

    Basic Login - Help Needed

    You are referencing the label in your code, you should reference your textbox. In your case: Username should be me.text1 Password should be me.text3 Also Username.SetFocus is not required and not possible, you can't set focus to a label.
  12. P

    Sending Query to Excel syntax issues

    Your calculated field name is a reserved word, try some other name.
  13. P

    Deleting record

    I assume ReserveringID is a number, for a number you can't use quotes (makes it a string) so your SQL has to be: strSQLDel = "DELETE FROM VRRESSTAF WHERE VRRESID = " & ReserveringID
  14. P

    Sum 2 expressions

    For the dutch regional settings the comma is for decimal places. Because numbers have no need for quotes the seperator for querys changed to a semi colun.
  15. P

    VBA SQL insert query

    I think because your field Entry date contains a space the SQL wil throw a error. Try placing square brackets around the filed name, "[Entry Date]". User is a reserverd word in SQL, temporary solve it by placing square brackets. Best way to avoid this kind of hickups by avoiding reserved names...
  16. P

    DoCmd.RunSQL not working anymore after db split

    If you're not asking for error trapping you won't get one, try executing youre SQL by: CurrentDb.Execute (strSQL), dbFailOnError This way if there is a error the code wil fail.
  17. P

    replace "www." with "http://www." to textbox

    You should test for http: as not all websites use www. Something like: If left(me.website, 4) <> "HTTP" then me.website = "http://" & me.website 'else 'do nothing (tested also for HTTPS) End if I would place the code in the afterupdate event of te textbox or in the before update event of the form.
  18. P

    Access 2003 - There was a problem etc

    In Excel under Windows 7 I had similar messages. Uncheck DDE solved my problem then. See: http://support.microsoft.com/kb/211494
  19. P

    Select query from another mdb

    It is possible and your sample is almost right, from the Acces help: SELECT* FROM tabelexpressie IN externaldatabase
  20. P

    Select a column and assign it different percentages for its 2 rows

    And if it need to be random record sort by randomizing like: SELECT TOP 8 * FROM [Questions] ORDER BY rnd(INT(NOW*[question id])-NOW*id) WHERE difficulty = "Easy" ; Union SELECT TOP 12 * FROM [Questions] ORDER BY rnd(INT(NOW*[question id])-NOW*id) WHERE difficulty = "Hard" ; The only...
Back
Top Bottom