Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    4

    Unanswered: Updating a field using InputBox

    Hi all,

    I am trying to write VBA that will do the following:

    In the current record, we have several fields, but most important is the MapID Number field. we use this field to track our map productions. We have a 2nd field called "Superseded" which we have to add in a new map number that will supersede the old map number.

    What I am trying to do is create a routine where: In the current record (the new map record with new MapID number), the user clicks on icon, "Supersede", which calls up the inputbox and prompt them to enter the old map number to be superseded. Then the Access should add the new MapID into the old MapID record's "Superseded" field automatically.

    How do I do about this?

    Thanks!

    -Erick

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Hi Erick,

    You may want to use the sql UPDATE statement in conjuction with the InputBox function to perform the task desired.

    I have provided a small sample db which shows how you can do this. The required code is located within the OnClick event for the Command Button (which has an Icon in it).

    Hope this helps....

    Attached Files Attached Files

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hey CyberLynx,

    I d/l your sample to check it out also, however anytime I click on the CommandButton I get an Access error: about performing an illegal operation... then it bales out on me. What gives?

    Bud

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Good question...I suppose. I can't seem to generate the error you are receiving. I transfers the ZIP file to several different computers and tried the sample on each of them. The sample worked fine on all systems with no errors.

    Has anyone else experienced this problem?

    You might try and start the sample DB while holding down the Shift key, then go into the Form's code module. While your there, see if you are MISSING any References (located in the Tools menu).

    You might also make sure that in the VBE options (Tools|Options|Gereral Tab) that you have Error Breaking set to Break On Unhandled. I have it set to Break On ALL Errors and I still don't get an error.


    Last edited by CyberLynx; 07-31-04 at 16:25.

  5. #5
    Join Date
    Jul 2004
    Posts
    4

    Thumbs up

    Wow... I've already figured some... but never thought of dlink. I've used some of your codes and modified for other parts, so it helps a great!

    Many thanks!

    -Erick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •