Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    automatically filled in control (Access 2000)

    Can i automatically fill in one control after i have filled in another? My problem is that i want this to happen only when a new cliend is addded.In my form i have a control named Allstat.The control ReedIDid should be
    equal to Allstat plus a 0.I have put the line
    Me!ReedID = Me![Allstat] & "0"
    in my button for closing the form,and it works but i have problems,because i want this condition to be valid only when a new client is added.Therefore this button updates all the data in the control Reedid which is
    not desirable

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automatically filled in control (Access 2000)

    You could put the code in the Before Update event of the form:

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    ' Check for new record
    If Me.NewRecord Then
    Me.ReedID = Me.AllStat & "0"
    End If
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automatically filled in control (Access 2000)

    Thank you Hans.It works just fine.Thanks again for your time. I really thought I had an issue here

Posting Permissions

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