Re: 'Roll Back' new record on form



hi Pedro,

pedro wrote:
Not sure what you mean by 'evaluate' the ID field - I assume the code adds one to the previous ID (this would replace an auto number field?)
Yes, that's correct. Use it in the BeforeUpdate event of your Form:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me![TransactionID] = Nz(DMax("TransactionID", "yourTable"), 0) + 1

End Sub



mfG
--> stefan <--
.



Relevant Pages

  • Re: ComboBox Macro Issue!?
    ... Private Sub ComboBox1_Change ... Confectionery Mfg from Purchased Chocolate", ... "48611 Pipeline Transportation of Crude Oil", ... Wood Product Mfg", "322121 Paper Mills", ...
    (microsoft.public.word.vba.general)
  • Re: ComboBox Macro Issue!?
    ... Private Sub ComboBox1_Change ... Confectionery Mfg from Purchased Chocolate", ... "48611 Pipeline Transportation of Crude Oil", ... Wood Product Mfg", "322121 Paper Mills", ...
    (microsoft.public.word.vba.general)
  • Re: ComboBox Macro Issue!?
    ... Private Sub ComboBox1_Change ... Confectionery Mfg from Purchased Chocolate", ... "48611 Pipeline Transportation of Crude Oil", ... Wood Product Mfg", "322121 Paper Mills", ...
    (microsoft.public.word.vba.general)
  • Re: ComboBox Macro Issue!?
    ... Private Sub ComboBox1_Change ... Confectionery Mfg from Purchased Chocolate", ... "48611 Pipeline Transportation of Crude Oil", ... Wood Product Mfg", "322121 Paper Mills", ...
    (microsoft.public.word.vba.general)
  • Re: auto number format
    ... add i get an error message saying that my table cannot be found i think ... network because i am in a multi-user envirorment I think I need more ... code or something but i know you shouldn't use an auto number but i ... Private Sub Form_BeforeUpdate ...
    (microsoft.public.access.forms)