Results 1 to 3 of 3
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    AutoIncrement Number

    I have a Primary Key that I need to append to by using a increment counter of sorts. Example; EventID is 30 I then want to append to the same table that has this EventID but add a record with .1 to it so that the new EventID would be 30.1 and the next would be 30.2 and so on.
    [EventID]+.1 And [Forms]![frmmissedevents]![EventID] I have this is a query grid to try and accomplish this, will this work?
    I will have several records in the table I am appending from with the SAME EventID
    I am using a form and append qry to try and accomplish this. I have a table with missed events that did not take place and need to add them back in but keep all of the original data except to update the dates, check number and some yes/no fields.



    For each missed event in my table I run the append query to modify the table tblEvent
    Example: Also needed is: Let's say my PK is 30 (EventID) and I want to change the below
    tblEventID EventID is PK
    MyDte Check Date
    EventStart Date() also used as check date
    ChkNo Greatest Check Number

    Let's say also that for ALL other EventID that are 30 I just need to increment the EvenID by .1 so it will be 30.1 and advance from there.
    Attached Thumbnails Attached Thumbnails MultipleMissedEventsForSameEventID.jpg  

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    I don't fully understand your post. I see EventID values repeating in your attachment - so clearly it is not the primary key field (which I guess is not displaying - which is fine). If the EventID field type is integer - then it must be changed to Single or Double to permit decimals - but then you should be able to add records to this table with 30.1

    Manually typing in 30.1 is fine of course. Automating that however is not easily set up. I see 4 records with EventID 30 - automating to change those to be 30.1, 30.2, 30.3, 30.4 would be tricky. First of all for the db to know which should be which (if it matters)...but I'm not sure from your post as to whether this is what you seek.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why is this necessary on form? Textbox on report has a RunningSum property that can be used to sequentially number records in each group.

    If you must save that value to table there are various methods.

    Review https://www.accessforums.net/queries...rts-31836.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 10-22-2012, 02:45 PM
  2. Alphabet autoincrement
    By KWHAT in forum Access
    Replies: 16
    Last Post: 05-23-2012, 08:29 AM
  3. Replies: 1
    Last Post: 05-22-2012, 10:46 AM
  4. Replies: 11
    Last Post: 02-13-2012, 10:06 AM
  5. Replies: 6
    Last Post: 07-25-2011, 01:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums