User Profile

Collapse

Profile Sidebar

Collapse
ramprat
ramprat
Last Activity: Jan 18 '10, 09:25 PM
Joined: Oct 20 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Run time error 429 Active X Component can't create object

    I have an Access database (Access 2003). I am running Windows 2000. Until recently I have been able to run VBA code within this database on my machine but lately when I try it I get the Run time error 429 Active X Component can't create object error when the code reaches the following line

    Set db = DBEngine(0)(0)

    This is part of the code below.

    Code:
    Dim db As Database
    Dim rs As Recordset
    Set
    ...
    See more | Go to post

  • ramprat
    replied to Big problem that shouldn't be
    Thanks I'll try it and see if it works.
    See more | Go to post

    Leave a comment:


  • ramprat
    started a topic Big problem that shouldn't be

    Big problem that shouldn't be

    Hi Everyone,

    I seem to be having a problem with something that should be quite simple. I have a table (AADT_History) with the following fields:

    PCID
    AADT
    UPDATE_YEAR
    OLD_PCID

    There can be multiple records for any PCID as it gets a new record added to the table each year. What I am trying to do is to select the most recent record (highest update_year) for each PCID but only where...
    See more | Go to post
    Last edited by Stewart Ross; Mar 6 '09, 08:16 PM. Reason: Sorted code tags - use brackets [as delimiters] before and after code and /code pairs.

  • ramprat
    replied to Can't append to first table in database
    Glad to see I'm not halucinating. Yes it is cheesy but what else can you do.

    Good luck.
    See more | Go to post

    Leave a comment:


  • Thanks Megalog. I appreciate you helping out the less experienced
    See more | Go to post

    Leave a comment:


  • forgive a seemingly dumb question but I've never split a database before. When I split a database the wizard creates a backend database for me holding nothing but the tables. How do I then link a front end database to this? Would I have to create a database with links to the tables in the back-end
    See more | Go to post

    Leave a comment:


  • Unfortunately it is a single database that everyone accesses at the same time.
    See more | Go to post

    Leave a comment:


  • I guess it would be better to use

    if get_global("g_u sername") = "" then

    etc


    I was hoping to create a table with only one record in it. It would be the record for the current user. I imagine this would then be visible to all users and more importantly would get overwritten each time someone logs in unless instead of a table I wrote the current username to a text file on the...
    See more | Go to post

    Leave a comment:


  • Thanks Stewart.

    I thought of that but thought that it might affect performance by always writing to a table. Also, I've already got more tables than I'd like in my database so I was hoping to avoid adding another if possible. Also, being a multi-user environment will that table not get overwritten each time someone logs in? If not, I suppose I could create a table called temp_globals and populate it with the values at login and then...
    See more | Go to post

    Leave a comment:


  • ramprat
    started a topic Preventing Global variables from being reset

    Preventing Global variables from being reset

    Hi All,

    I currently need to store 3 variables to be used as global variables throughout my application. I need to record the username, their employee group and the task they are doing. The username, for example, is entered into a field on a table to indicate who last worked on that particular record. I have created the code below and it seems to work fine except when the application occasionally errors out at which point the global...
    See more | Go to post

  • Hi ChipR and NeoPa,


    I am happy to report that it appears that the problem has been solved. I created a workaround (sometimes we don't always see the simpler solution). I simply added the following line of code to the click event of the button on my form.
    Code:
    Me.Pre_05_growth_factor = DLookup("[pre_05_growth_factor]", "traffic", "[pcid] = " & Forms![count_stations_form]![PCID])
    ...
    See more | Go to post
    Last edited by NeoPa; Jan 15 '09, 04:11 PM. Reason: Please use the [CODE] tags provided

    Leave a comment:


  • I did not fix the where clause of the delete query because that part of the code is old and has been running fine for over a month and a half. Only the pre_05 variable part is new. Anyway, I put in a msgbox after the docmd.runsql and it doesn't get to it. Basically the continuous form (which is based on my traffic table ) goes white and then I get the option to send an error report and close.
    See more | Go to post

    Leave a comment:


  • ChipR,

    I may be making progress. Modifying the code to what you said gives me the following in the immediates window:

    UPDATE Traffic SET Traffic.PRE_05_ GROWTH_FACTOR = 0.05 WHERE (((Traffic.PCID )= 3012594 )) but alas it still crashes if I let it run the docmd.runsql strsql

    Code:
     
    strSQL = "UPDATE Traffic SET Traffic.PRE_05_GROWTH_FACTOR = 0.05 " & _
                          "WHERE
    ...
    See more | Go to post

    Leave a comment:


  • This is what comes up in the immediate window when I use the debug.print strsql

    UPDATE Traffic SET Traffic.PRE_05_ GROWTH_FACTOR = .05 WHERE (((Traffic.PCID )=[forms]![count_stations_ form]![pcid]));
    See more | Go to post

    Leave a comment:


  • I have to retract that last statement. It appears to be crashing any time even though I've hard coded a number into the statement in place of the Pre_05 variable just as a test.
    Code:
    strSQL = "UPDATE Traffic SET Traffic.PRE_05_GROWTH_FACTOR = .05 " & _
                          "WHERE (((Traffic.PCID)=[forms]![count_stations_form]![pcid]));"
    See more | Go to post

    Leave a comment:


  • ChipR,

    Being rather new to VBA I'm not sure what you mean when you say "let's see what it looks like if you copy it from the immediates window in the vba ediotor (Alt+F11)" Is this something that I do before I try to run the code through the form because once I run the code as normal the database crashes and that's all she wrote. I have noticed that if the value of Pre_05 turns out to be null (in other words the previous...
    See more | Go to post

    Leave a comment:


  • No ChipR I'm afraid it still crashes after executing those last 3 lines of code even with your changes.

    Would I be better off (although I think this is an ugly way to do it) to create a temp table to store the value and then use that table in my update query and then delete the temp table when finished?
    See more | Go to post

    Leave a comment:


  • Thanks I'll try it and let you know.
    See more | Go to post

    Leave a comment:


  • Hi ChipR but the code works as is except for the database crashing. Are your suggestions designed to stop the crashing? Thanks again for helping.

    ramprat
    See more | Go to post

    Leave a comment:


  • Why do these 3 lines of code work but crash my database?

    I am using a Dlookup to pull a value from my traffic table for a record prior to moving that record to a traffic_history table. I want to take the value and store it in a variable and then populate a new record in the traffic table with that value based on a unique PCID. This code is triggered by the click event of a button on my form after someone enters a new traffic count into my continuous form. The code takes the old count and puts it into the...
    See more | Go to post
No activity results to display
Show More
Working...