Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Location
    Houston, Texas
    Posts
    74

    Unanswered: Auto Replicate the Auto Number....

    I have a access 97 table called tbl_groups. There is a field (Auto Numbered) called Ga_Record_ID and set to auto number. I have another field called Ga_Record_ID_2 where I would like ga_record_id to be filled be filed automatically. That means when end user add a record access will automatically assign ga_record_id b/c it is a auto number field. The same number should appear in Ga_Record_ID_2 field. Ga_Record_ID_2 field is a text field. Any prompt help will be appreciated.

    >> reply: the suggession using form would not work. I would like to have the value input permanently in ga_record_id_2 (text field) which should be same value as ga_record_id (auto number field).

    >> I want this change to take place in the table. End user will not see in the form. Nor it's related to any of my form. I DON'T THINK LAST TWO RESPOND HELPED ME RESOLVED THE ISSUE. ANY PROMPT HELP WILL BE APPRECIATED.

    >> Ok, may be i was not clear. I am using ACCESS 97. i wanna put something for this field ga_record_id_2 in the table design mode. we are not talking about form, report or any of that.

    >> Finally it worked. I had to create another form in order to get this function work. I used the form_boforeinsert and it worked. THANKS A MILLIONS FOR ALL THE SUPPORT AND PROMPT HELP.
    Last edited by doran_doran; 02-06-03 at 11:49.

  2. #2
    Join Date
    Jan 2003
    Location
    Dordrecht, The Netherlands
    Posts
    95

    Re: Auto Replicate the Auto Number....

    If you use a form for inserting the records, you can insert VBA code like this in the Form_BeforeInsert sub:

    Ga_Record_ID_2 = Ga_Record_ID.

    By doing this the value for Ga_Record_ID_2 is permanently stored in the table (what you say want in your reply!) when you update the record, e.g. by moving to another record in your form.
    Last edited by Ad Dieleman; 01-25-03 at 04:12.

  3. #3
    Join Date
    Jan 2003
    Posts
    15
    Not understanding what you are trying to do here....

    Ga_Record_ID_2: =([Ga_Record_ID])

    In the name of the field will repeat all values of the original Ga into Ga2.

  4. #4
    Join Date
    Jan 2003
    Location
    Dordrecht, The Netherlands
    Posts
    95
    It will copy the value of Ga_Record_ID to Ga_Record_ID_2 for the current record only if you insert the statement into the Form_BeforeInsert Sub (open the code window for the form). Maybe you are referring to an update query? This is a different thing. BTW, in VBA you don't use ':=' but '=' for assigning a value to a variable.

    Ad Dieleman.

    Originally posted by War
    Not understanding what you are trying to do here....

    Ga_Record_ID_2: =([Ga_Record_ID])

    In the name of the field will repeat all values of the original Ga into Ga2.

Posting Permissions

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