Recent content by hamrthroer

  1. hamrthroer

    for all that is good help!

    Sorry Bob! That fixed it right up! I was so excited I started readying for the implimentation. Thank you all again for your assistance! I'm sure this won't be the last time. :D
  2. hamrthroer

    for all that is good help!

    Ok. Almost done the export. I have to also add days off to the query. I have it done but for a missing operator. Here is the code, followed by the results in the immediate window. strSQL = "SELECT tblStaff.StateEntryDate, " strSQL = strSQL & "tblStaff.LastName, "...
  3. hamrthroer

    for all that is good help!

    Thanks Bob! Finally!!!!!! I still need to manipulate the days off using a lable on the same form (frmMain) but I can role that out after this. Thank you all for your assistance. Any advice to make this less painfull?
  4. hamrthroer

    for all that is good help!

    Here is what I got in the immediate window (thanks I've never used that before). SELECT tblStaff.StateEntryDate, tblStaff.LastName, tblStaff.FirstName, tblStaff.MI, tblStaff.PriPhone, FROM tblStaff WHERE ((((tblStaff.Shift)="8-4") AND ((tblStaff.Rank)='COI'OR (tblStaff.Rank)='COII'OR...
  5. hamrthroer

    for all that is good help!

    Bob I get the select statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
  6. hamrthroer

    for all that is good help!

    tblStaff.Shift is text I'm calling this function from a command button on frmMain I would like this module to be flexible so that it can use it in other databases with modification. But this is due tomorrow so whatever will work. Thanks again
  7. hamrthroer

    for all that is good help!

    I've got errors with both methods. Stupid question but how do I define myID as text? Also on this line of the SQL I get error end of statement expected: strSQL = strSQL & "WHERE (((tblStaff.Shift)=" & Chr(34) & Forms!frmMain.cboRptShift & Chr(34)) "
  8. hamrthroer

    for all that is good help!

    I changed the datatype for MyID from long to string and removed an extra ) and it opens the spreadsheet but doesnt insert the info. It is so strange that if I take out the form reference the export is successfull but I need the reference.
  9. hamrthroer

    for all that is good help!

    Call code: Call ExportOvertime(Me.cboRptShift, "strSQL", "OvertimeLocalShift", "X:\Overtime Spreadsheet\OvertimeCallDown") Module Code: Public Function ExportOvertime(myID As Long, strTQName As String, strSheetName As String, strFilePath As String) ' strTQName is the name of the table or...
  10. hamrthroer

    for all that is good help!

    Ok. I modified the code as jzwp22 advised and I get a type mismatch on the call : Call ExportOvertime(Me.cboRptShift, "strSQL", "OvertimeLocalShift", "X:\Overtime Spreadsheet\OvertimeCallDown") JR I pasted the query into the blank SQL it runs but when I put it into code I get the original...
  11. hamrthroer

    for all that is good help!

    I'm not understanding (big suprise)... If I take out the form reference then there is no way to offer the user an option for differenciating which shift they want to export. I also tried using Debug.Print strSQL and I get nothing. Should I place it after I set strSQL?
  12. hamrthroer

    for all that is good help!

    False alarm. The export executes but does not recognize the variable supplied by the form. Any ideas? BTW I am calling this using: Call ExportOvertime("strSQL", "OvertimeLocalShift", "X:\Overtime Spreadsheet\OvertimeCallDown")
  13. hamrthroer

    for all that is good help!

    You are a life saver! I had to add a ) in there and voila! My next torture oportunity is to add another variable on the same form titled weekday but I think this lesson should guide me through it. I'll post an update when all is complete. thanks again! PS: I will use the code tags as...
  14. hamrthroer

    for all that is good help!

    I have this module to export a spreadsheet. The issue is with the SQL statement. I have tried both the stored query and using it in code. When I take out the reference to forms!frmMain!cboRptShift the export is successfull. I need this reference to correctly create the export as well as another...
  15. hamrthroer

    If statement for sort order

    I got it worked out. I seperated the report in two and took the micky mouse approach with a dialog box and command buttons. I have alot of changes and have to move on. Next I have to export a report into an excel spreadsheet. Should be torture. Thanks for all of your help!
Back
Top Bottom