Search results

  1. B

    Run Time error '424' Object required.

    Thanks for your help ajetrumpet! That was it. Have a great weekend!
  2. B

    Run Time error '424' Object required.

    It's Friday and I'm not seeing straight! Can you spot the reason I'm getting this error? I get the error on bold red line in the code. Thanks. Here's my code: Public Function GetCircuitExtInspDatesFromLines() 'Dim x As Integer 'Changed Circuit External Inspection date count. Dim db As Database...
  3. B

    Renaming Duplicates

    I'm using a Access97 query to rename assets in another database based on a set or criteria. Unfortunately, this criteria creates some duplicates that will need to be corrected manually in the other database. So, I'd like to "mark" the subsequent duplicates by appending the asset name with the...
  4. B

    Invalid Procedure Call error on foreign key expression.

    Ding Ding Ding Ding - We have a winner! That was it Wayne! Thanks. I'll account for those exceptions in my expression. Thanks for your help too Bob!
  5. B

    Invalid Procedure Call error on foreign key expression.

    Thanks again Bob, But when I swapped them like this: CirNo: Left([tbl_IntExt].[ASSETID],InStr(5,"-",[tbl_IntExt].[ASSETID],2)-1) I get "#Error" in the datasheet view. I've also tried Null, 0,1 & 2 for the compare flag with no positive results. It's a pesky little problem. Rick.
  6. B

    Invalid Procedure Call error on foreign key expression.

    Thanks for the quick reply Bob. My first string is the contents of [tbl_IntExt].[ASSETID] My second string is hard to see, it is a dash "-" The one (1) is to return text, 0 is default for binary. CirNo: Left([tbl_IntExt].[ASSETID],InStr(5,[tbl_IntExt].[ASSETID],"-",1)-1)
  7. B

    Invalid Procedure Call error on foreign key expression.

    Hi, I'm attempting to create a foreign key field in a sub-query by using Left() and Instr() to parse the text of my key field and return the characters prior to the second "-". Example: 002-C100-4569 ---> 002-C100 When I build a second query with a relationship between the foreign key field...
  8. B

    Pesky quotes

    Thanks checoturco, Yes, it returns "Run-time Error 3021: No current record." I believe that is because adding double quotes on the nbrSec variable interprets it as text, and it is a Long interger. I believe the problem is my usage of quotes around my strAPI variable. None of the following...
  9. B

    Pesky quotes

    I could use some help. If you could review my code below I would appreciate it. It generates the following error: Run-time Error 3075: Syntax error (missing operator) in query expression '((([tbl_UnitList].[SectionCode]) = & nbrSec & ) And (([tbl_UT].[APICode]) = "));' Notice please that the...
  10. B

    txt to # and back & keep leading zeros?

    That worked perfectly. Many thanks Paul.
  11. B

    txt to # and back & keep leading zeros?

    Hi all, I have a sql statement I am using in a VBA sub that I intended to find the maximum value of the last three characters in a text field (JOB_NO) whose values are all in this format - "00L000". Example - "05J123" It works fine when the last three characters represent a 3 digit number like...
  12. B

    I feel so dirty!

    Can you please take a look at this code and tell me what I'm doing wrong? Objects on the form are not enabled on new records even if my criteria matches?? This code is on the click event of a "New Record" button that launches lauches a form, creates a new record and puts the userID into the...
  13. B

    ERROR:Unable to impersonate a DCOM client???

    That worked, Thanks again! I was faced with a datatype error that was solved by adding a "group by" to my query. sql = "SELECT Count(PC_PCRLog.PCR_No) AS CountOfPCR_No " & _ "FROM PC_PCRLog " & _ "GROUP BY PC_PCRLog.AFE_No " & _ "HAVING (PC_PCRLog.AFE_No)='" &...
  14. B

    ERROR:Unable to impersonate a DCOM client???

    Thanks Wayne, Partial success. I took your advise and removed the space from my table name and changed the query accordingly. My problem now is AFE_No is a text field that contains two periods "XX.XXXX.XXXXX" and I get a RunTime 3075 - an illegal use of "."'s Refresh my memory, how do I...
  15. B

    Call another Sub Routine

    Me too, but don't tell anyone. It'll be our secret :D
  16. B

    Call another Sub Routine

    csprop, Try creating a Public Function or Sub in it's own module and call it from a Private Sub using: CALL My_Function or My_Function or =My_Function() Do a help search for Public vs. Private Good luck.
  17. B

    ERROR:Unable to impersonate a DCOM client???

    Hi, I get the subject error when I run this code. :confused: Private Sub AFE_No_Change() Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim sql As String sql = "SELECT Count([PC_PCR Log].AFE_No) AS CountOfAFE_No " & _ "FROM [PC_PCR Log] " & _ "HAVING (((Count([PC_PCR...
  18. B

    Trouble adding and editing with same form.

    Thanks for the quick response Kev, I want all users to view all records, but only edit theirs. I also found my problem. It was my logic, or the order of the commands in my VBA script. 1. I was launching my form 2. Creating a new record 3. Placing values in the controls 4. Then seting the form...
  19. B

    Trouble adding and editing with same form.

    Hi all, I have one form whose record source is a table. I am attempting to use the same form to both add new records and edit records. I also use a hidden form to store the users ID for comparison to prevent users from editing records they did not create. My problem is I can not create a new...
  20. B

    Trouble passing value across forms - syntax?

    Hi all, I have a form that I would like to use to edit existing records and create new ones. I have written code for a new record button and I am having trouble passing a value from one form to the other. I get a 2427 "...expression that has no value..." error. Can you look it over for me...
Back
Top Bottom