Search results

  1. W

    Report printing incorrectly - but OK on Screen

    Hi All, I'm really confused with this one. I have a report based on a dynamic crosstab query using the method I found here: http://support.microsoft.com/kb/328320 The report itself run perfect and all of the data is correct when I view in either Print Preview or Layout preview modes. The...
  2. W

    Time Formats

    Hi again! assuming your "hours" textbox has the hours like 24.5 for 24hrs 30mins etc. you could use the following: assuming your hours text box is called txthour in this example =Int([txthour]/24) & " days " & Int([txthour]-(Int([txthour]/24)*24)) & " hours " &...
  3. W

    Current User List Form

    No problem! Good luck with your project!
  4. W

    Current User List Form

    Hi sorry my PC was playing up and I missed your post regarding the UserID been a number. It does make a difference :) For numbers you need to remove the ' So change DoCmd.RunSQL "UPDATE tblUser SET tblUser.[Logged In] = True WHERE tblUser.UserID = '" & cboUser.Column(0) & "'" to...
  5. W

    Current User List Form

    That's confuses things! This is a long shot but are you running the code with the table open, if you make sure the user is unticked in the table, close the table then run the login, then open the table again is the box now ticked?
  6. W

    Current User List Form

    Add this directly before the docmd.runsql line: msgbox Forms!frmLogin!cboUser.Column(0) A message box should pop up with the value in it. Does it match the name in the field from your table? If not please repost your code how it is now Cheers Chris
  7. W

    Current User List Form

    That looks like were getting somewhere now! So it appears that cboUser.column(1) isn’t passing the value through. I think this is because of the position of the code, you are opening the “Navigation” form and then trying to pull from cboUser.column(1), which doesn’t exist on the...
  8. W

    Current User List Form

    Hi, Is the username a text field or is it a user number? I'm assuming the username is in text in the above example. What I would try and do is target just one entry for the minute to try and to locate the problem. So i'd change WHERE tblUser.UserID = '" & me.cboUser.Column(0) & "'" to...
  9. W

    Current User List Form

    Hi, I've just tested and the below should work fine: I've changed this: DoCmd.RunSQL "UPDATE tblUser SET tblUser.[Logged In] = 'True' WHERE tblUser.UserID = '" & cboUser.Column(0) & "'"to this: DoCmd.RunSQL "UPDATE tblUser SET tblUser.[Logged In] = 1 WHERE tblUser.UserID = '" &...
  10. W

    Current User List Form

    Please note edit above, and also change = 'yes' to = 1
  11. W

    Current User List Form

    Sorry I've not got access to a computer at the min (just finished work and on the way home). My guess is change this WHERE UserID = '[cboUser.Column(0])'" To WHERE UserID = '" & cboUser.Column(0) & "'" Let me know if no joy and ill take a look at first chance I get Cheers Chris
  12. W

    Current User List Form

    Hi, I'm guessing that you have a table with all the users in? Here's a possible solution. Add a column in the table for the status to go in e.g. "Status" When the user logs in add the following line the the login button: docmd.runSQL "UPDATE tablename SET Status = 'Logged in' WHERE Username...
  13. W

    Checkbox to hide / show series in embedded chart

    Hi Leon, Apologies for the delay, bit of a busy start to the week! Here's the code: SQL = "SELECT ""Wk"" & (Format([WeekCommencing],""ww yy"")) AS WeekNo" If Forms!frmMain.chk4wk = True Then SQL4Wk = ", Sum(qryDataFilter.[4wkAverage]) AS 4wkAverage" End If If Forms!frmMain.chk13Wk = True...
  14. W

    Checkbox to hide / show series in embedded chart

    Thanks Leon, I actually found a solution, instead of trying to edit the chart I actually changed the SQL source code depending on what checkbox was checked, this now works perfect. When I get to work tomorrow i'll add my code to this thread as a possible solution for others Cheers Chris
  15. W

    Checkbox to hide / show series in embedded chart

    Hi All, I've spent the last two days trying to figure this out - searching all over the web! I'm fairly comfortable with vba / access but this one has got me stumped! I have chart (grpMaster) that is embedded in a form (frmMain), the chart is a line graph based on a query (qryDataFilter) with...
  16. W

    SQL Problem, sorting on calculated field?

    Resolved: I changed the code to the following and it worked: STRSQL = "Select DISTINCTROW [item-no], Description1, Sum(TransQty) AS [TotalTransQty],(dLookup(""Unit"", ""tblCost"", ""[item#]="" & [Item-no])*SUM(TRANSQTY)) AS [Value] FROM tblScrap WHERE (((tblScrap.[Reason Code])='scrp')...
  17. W

    SQL Problem, sorting on calculated field?

    Morning, I have the following sql in vba to add up all the values of a column (tblscrap.transqty). I then want to sort on this criteria. I have put this into the query and the query works fine, so i've copied the sql into VBA but get the following error Run-time error '3061'. Too few...
  18. W

    Using Between in VBA?

    So simple when you know how! Thanks this worked perfect! Cheers Chris
  19. W

    Using Between in VBA?

    I've even pulled the SQL out of a working query and added this in, I still get the same error with the following code: strsql = "Select * FROM tblScrap WHERE (((tblScrap.[Reason Code])='scrp') AND ((tblScrap.[trans-date]) Between " & [Forms]![frmMain]![txtFrom] & " And " &...
  20. W

    Using Between in VBA?

    Thanks for the help! [trans-date] is a date and example of a value in the above field is "03/09/2012" I've also tried the above SQL without the "format(......)" Chris
Back
Top Bottom