RE: how to update a field record based on inputbox?

Discussion in 'Microsoft Access Forms' started by Steve Sanford, May 15, 2010.

  1. It looks like you have a button named "botãodecomando" on the form that you
    click when you want to update the field.

    Try this (modified) code:

    '-------------beg code--------------
    Private Sub botãodecomando_Click()
    Dim Strg As String
    Dim sTitle As String
    Dim sPrompt As String
    Dim sFechado As String

    sFechado = Me.Fechado
    sTitle = "Técnico BPO - Rdinis"
    sPrompt = "Escreva Sim para Fechar o Processo."
    sPrompt = sPrompt & vbNewLine
    sPrompt = sPrompt & "Escreva Não para Manter o Processo em Aberto."
    sPrompt = sPrompt & vbNewLine & vbNewLine
    sPrompt = sPrompt & "O estado actual do processo está fechado?"

    Strg = ""
    Strg = InputBox(sPrompt, sTitle)

    If Len(Strg) > 0 And Strg <> sFechado Then
    Me.Fechado = Strg
    End If

    End Sub
    '-------------end code--------------

    HTH
    --
    Steve S
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)


    "puppetmint" wrote:

    > Hello access friends,
    > Thanks for helping.
    >
    > First of all, let me tell you that i have a form named "Processos" based on a
    > table named "Processos Rdinis", and this table has a primary Key named
    > "IDdeProcesso", a fiel named "Fechado" and another field named
    > "IDdeCandidatura". My question is how do i get an input box to update the
    > record on the field named "fechado" when i'm in the form named "Processos". I
    > need the input box to tell me the current state of the field, and to update
    > it if necessary.
    > The first part is working, i can see the present state of the field, but i
    > don't know how to update it.
    > this is the code that i have:
    >
    > Private Sub botãodecomando_Click()
    > Dim Strg As String, SqlStrg As String
    > Dim Fechado As String
    >
    > Fechado = Me.Fechado
    > Strg = ""
    > Strg = InputBox("Escreva Sim para Fechar o Processo." & vbNewLine & "Escreva
    > Não para Manter o Processo em Aberto." & vbNewLine & vbNewLine & "O estado
    > actual do processo está fechado?" & vbNewLine & Fechado, "Técnico BPO -
    > Rdinis")
    >
    > End Sub
    >
    > Thank you all for your help.
    >
    > .
    >
     
    Steve Sanford, May 15, 2010
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Simsion
    Replies:
    3
    Views:
    169
    Kelvin
    Nov 17, 2003
  2. Kim
    Replies:
    0
    Views:
    327
  3. circuit slave
    Replies:
    6
    Views:
    815
    circuit slave
    Jan 26, 2006
  4. Replies:
    10
    Views:
    339
    doebtown
    Aug 28, 2006
  5. wolfiewoman

    Update new record with previous record field

    wolfiewoman, Feb 19, 2009, in forum: Microsoft Access Forms
    Replies:
    5
    Views:
    244
    Jeff Boyce
    Feb 23, 2009
Loading...

Share This Page