Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi: Actually, GetNumOfWorkdays is a function that I made. Many of our employees have their "weekends" on days other than Saturday and Sunday. Also, the "w" (weekday-only option) flag for VB's DateDiff does not work. So I wrote a short custom function to calculate the number of working days...
  2. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi Everyone: It looks like Golom got it exactly right. When I inserted into the SELECT clause, the fields being used in the ON clauses for the JOIN operations, AND did my .UpdateBatch - it worked perfectly. When I kept the .UpdateBatch commented out, it did not work. However, I suspected that...
  3. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi Golom: Thanks for your suggestions. When I look at the .Status property, it gives me "0" (adFieldOK) - which is the default according to MS documentation. When I do Debug.Print .Fields.Item(1).value & " " & .Fields.Item(0).value it shows the values in the fields to be...
  4. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi Tyrone: I define my connection ("conn") globally so that I need to open it only once (e.g. when the database's primary form opens at startup). The tables in question do have primary keys. I have attached a PDF of my relationships report if you care to see it. I've been mulling over how to...
  5. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi MajP. Are you suggesting that I use an UPDATE - SET - WHERE? My call to GetNumOfWorkdays requires information from one of the other tables that is not being updated (hence the INNER JOIN in my SQL string). How would I make that work in the context of an UPDATE? Perhaps as a sub-query...
  6. zepphead80

    Problem with .UpdateBatch in ADO...

    Thanks for your reply Tyrone. I commented my .UpdateBatch out, and it does get rid of the error, but it also does not update the table. Is there a restriction on using a JOIN in this situation?
  7. zepphead80

    Problem with .UpdateBatch in ADO...

    Hi: I am attempting to pull a backend table into a local recordset, make some changes to it, and commit the changes back to the table. I'm using an ADO recordset in Access 2007. The backend resides on a network drive while the front end is on my C: drive. My code is as follows: Dim...
  8. zepphead80

    Parameterized SQL UPDATE problem

    Hi all: I've got one of those problems that I just can't get around, no matter what! I'm working in Access 2007/VBA, using an ADO command structure. In my code, I've got a SQL UPDATE like: strSaveLeave = "UPDATE tblLeave SET fldLeaveType = @LeaveType, fldLeaveStatus =...
  9. zepphead80

    access SQL query help... complex for me, simple for you??

    JoeAtWork is 100% correct...my test won't work. I did not look closely enough at your problem. I guess the reason that I went with the structure I presented is that domanicap states that the string, the letter and the response are all in the same field. That doesn't quite match up with the way...
  10. zepphead80

    Problem with DSum / Undefined function in expression error...

    Works beautifully. Thanks so much. I have learned a crucial thing about VB modules today...
  11. zepphead80

    Problem with DSum / Undefined function in expression error...

    Well I have done those things, but how do I tie the form to the new module? Now nothing on my form works (i.e. when I click a command button it doesn't do anything, etc.)
  12. zepphead80

    Problem with DSum / Undefined function in expression error...

    Ah ha! This module is behind my form. I'm pretty new to VBA so how can I turn this into a standard module and keep my form connected to it?
  13. zepphead80

    access SQL query help... complex for me, simple for you??

    Hi: Shouldn't be too hard. Assuming that the string, the letter, and the response is all one long string, you need to use a string function to pick out the correct responses. For instance: SELECT [Name of your table].* FROM [Name of your table] WHERE (Right([Name of your...
  14. zepphead80

    The recordset is not updatable

    I'm not really that familiar with ADODB, but one thing you should do is set a debugging breakpoint close to the beginning of this procedure you have provided code for (let's say on the line "Set cn= * * *"). Then, when the application hits the breakpoint, step through the code line by line until...
  15. zepphead80

    The recordset is not updatable

    Have you tried saving the database in Access 2007 format (.accdb) then re-opening it?
  16. zepphead80

    Problem with DSum / Undefined function in expression error...

    I made qryTest in Access' query design window, and it resides in that part of Access...not in my VB module. How do I reference my function in the query? Also, the function is NOT declared as Public - I just have Function getNumberOfWeekdays(* * *) for the declaration; could that affect this...
  17. zepphead80

    Problem with DSum / Undefined function in expression error...

    The SQL for qryTest is: SELECT tblEmployees.*, tblWC.*, tblEmployees.fldPayDistCode FROM tblEmployees INNER JOIN tblWC ON tblEmployees.fldERN = tblWC.fldERN WHERE (((Right([tblEmployees]![fldPayDistCode],1))="2")); This query does what I want it to, both when I run the application, and run it...
  18. zepphead80

    Problem with DSum / Undefined function in expression error...

    Sorry, I left that part out... I commented out the DSum() line and ran a test on my function as such: a=getNumberOfWeekdays(#08/24/07#,#08/29/07#) b=MsgBox("The number of weekdays is " & a, vbOkCancel) The message box popped up with the correct result, so I know the function works OK. Also...
  19. zepphead80

    Problem with DSum / Undefined function in expression error...

    Hi Remou: The code compiles fine. It fails at runtime. When I use DateDiff() instead of my function, it works fine at runtime. But I'm not using DateDiff() because the 'w' option is broken, and I can't have weekend days in my results. So I'm stuck with the need to make my function work. Why...
  20. zepphead80

    Problem with DSum / Undefined function in expression error...

    Thank you for replying... When I remove the double quotes, I then get an error saying Microsoft Access can't find the field | referred to in your expression. Also, the MS help pages say, and I quote, "If expr includes a function, it can be either built-in or user-defined, but not another...

Part and Inventory Search

Back
Top