Search results

  1. G

    How to check which product is most popular

    My query should add all the qty for one product and put the highest one on top. But i agree with JHB. Maybe you can use 2 querys because it is possible that the biggest spender is on the first result but you get on the second result the highest qty.
  2. G

    Forms path Advice

    I made a small change so that the order doesn't matter : Dim ctl As Control Dim i As Integer Dim sControlName As String sControlName = "Saterday" i = 1 For Each ctl In Me.Controls If ctl.Name = sControlName & CStr(i) Then Debug.Print ctl.Value i = i + 1 End If Next...
  3. G

    Forms path Advice

    You can do something like this : Dim ctl As Control Dim i as Integer Dim sControlName as String sControlName = "Saterday" i = 1 For Each ctl in Me.Controls If ctl.Name = sControlName & Cstr(i) Then debug.print ctl.Value End If i = i + 1 Next The code will loop over all the...
  4. G

    Displaying last date in a text box from another forms subform

    You can do this by changing the recourd source of the subform subfrmPMTasks into something like this : select PMTasks.*,Max(PMTaskDetails.CompletionDate) from PMTasks join PMTaskDetails on PMTasks.TasksID = PMTaskDetails.TaskID That way you can mix fields from different tables in one form...
  5. G

    How to check which product is most popular

    Try something like this : SELECT Sum(Tabel1.SalesPrice) AS SomVanSalesPrice, Tabel1.ProductCode, Tabel1.Customer, Tabel1.Qty FROM Tabel1 GROUP BY Tabel1.ProductCode, Tabel1.Customer, Tabel1.Qty Order by Tabel1.Qty DESC,Sum(Tabel1.SalesPrice) DESC
  6. G

    Looping through numbers to add a value to a field

    I like to name field like that in a way it make sense. In your case i would have picked Is_Unique so i know that it is a yes/no field
  7. G

    CDO attachment

    Have you tried to right click the attachment and save it somewhere on your computer ? Maybe the security in office blocks email files. Also if the Global declaration worked for you i guess you did something like this : sub formA () Dim strxlfile3 as string end sub then you did something like...
  8. G

    CDO attachment

    If you create a variable in form A try to use it in form B it only works if it is a global variable (defined in a module) http://www.blueclaw-db.com/access_database_global_variable.htm It is not the case right now. So my question is how to you initialize the strxlsfile3 in form B ?
  9. G

    Access 2013 IIf #error

    Maybe you should ask yourself this : So I dont know why you added the quotes in the first place, but any text that is between double quotes is just a plain text for Access.
  10. G

    Using Minus operator

    You can try this : strsql = "select HeadingID from lkupHeadings where NOT EXISTS (select HeadingID from lkupobjectives where lkupobjectives.HeadingID = lkupHeadings.HeadingID [StaffNumber]='" & Environ("Username") & "'" Or NOT IN or just a plain old left join. In any case, Access doesn't...
  11. G

    DateAdd Function in a Computed Querry

    I'm from Belgium and we use the , also as decimal point. I haven't ran into a similar problem yet (Maybe a good time for me to see this post before pulling my hair out) Most of the time I use calculated fields on the form itself. And if i need SQL i write the full statement in VBA code. I don't...
  12. G

    DateAdd Function in a Computed Querry

    Does a delimiter in VBA changes from location ? If it is grats to the guys who wrote the compiler... the official help say to use "," for that specific function. But I can be wrong
  13. G

    DateAdd Function in a Computed Querry

    Maybe take a quick look at this : http://www.techonthenet.com/access/functions/date/dateadd.php So you need to use a comma. Then I think the code returns an error because "y" isn't valid. Try it with the correct syntax and give it a try. DateAdd("yyyy",5,[Datentry])
  14. G

    hey

    Words like "URGENT" and "ASAP" sounds like "this is a school homework and i didn't listen to the teachers class" There are pretty good tutorials out there who teach you in 5 minutes the difference between all the joins that you can make...
  15. G

    VBA SQL with SELECT Statement

    Not 100% sure what you try to explain with that is null. But here is what i guess : "select * from tblecalendar where (assigned = '" & userLevel & "' and (finalreport="&finalDate&" or finalreport is Null) Order by auditid" So what i think the problem is that you didn't put the last criteria...
  16. G

    Get email addresses from table

    OpenRecordset("table") is actually DAO... If you used ado you would need a connection string. Something like this : Dim rs As New ADODB.Recordset Dim strSql As String strSql = "SELECT * FROM Table1 WHERE Field2 = 33" rs.Open strSql, CurrentProject.Connection Do...
  17. G

    Get email addresses from table

    I prefer DAO over ADO. I don't understand why you say that it is not needed... Dim dbs As DAO.Database Dim rsSQL As DAO.Recordset Dim strSQL As String Set dbs = CurrentDb 'Open a snapshot-type Recordset based on an SQL statement strSQL = "SELECT * FROM Table1 WHERE Field2 = 33" Set rsSQL =...
  18. G

    Cdate problem

    Why try to make a date like that ? If you have 3 different fields you can do this : TDAY = DateSerial(Me.Combo25,Me.Combo21,STR(S1) (You still need to test off course the values are valid.)
  19. G

    Consealing Everything but the Access Forms

    A quick search on the interweb gave me this link : http://www.access-programmers.co.uk/forums/showthread.php?t=217400 Maybe it can do what you try to achieve.
  20. G

    Manipulate test string

    Yes you can rename that 's'. Just make sure you replace all the 's' in the code by that new name. There are 2 declarations on that first line. One is to tell that the 's' must be a string. (the parameter of that function cannot contains numeric characters) The second one is to tell what the...
Back
Top Bottom