Results 1 to 5 of 5
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form's Text Box Doesn't Update Table (2003)

    Because you don't have a line

    rst.Update

    (Puhleeeze remove that unnecessary reference to OWC11! <img src=/S/bash.gif border=0 alt=bash width=35 height=39>)

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form's Text Box Doesn't Update Table (2003)

    Thank you Hans, darned OWC11 <img src=/S/blush.gif border=0 alt=blush width=15 height=15>, I keep on forgetting to delete the reference when I slim the file down in order to zip it.
    Do you think it's possible to not only input the value that ends up in the PortVap table but also to display it using the same "ap" text box in the FrmMeteo form?

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form's Text Box Doesn't Update Table (2003)

    If I select say, March 20, 2006 on the calendar in the startup form of the attached mdb, click the METEO button and proceed to type
    e.g. 6 in the AP text box, why doesn't the value get transferred into the Vap_MIL_PREC field in the PortVap table?
    I'm using the following code to effect the transfer but no error messages occur.

    <pre>Private Sub ap_AfterUpdate()
    Set cnn = CurrentProject.Connection
    rst.Open "portvap", cnn, adOpenKeyset, adLockOptimistic
    rst.Find ("Giorno=" & [Giorno])
    If rst.EOF Then
    Dim cmd1 As ADODB.Command
    Set cmd1 = New ADODB.Command
    With cmd1
    .ActiveConnection = CurrentProject.Connection
    .CommandText = "INSERT INTO portvap(giorno, Vap_MIL_PREC) VALUES (#" & _
    Format(Me.Giorno, "mm/dd/yyyy") & "#, " & ap & ")"
    .CommandType = adCmdText
    .Execute
    End With
    Else
    rst.Fields("Vap_MIL_PREC") = ap
    End If
    On Error Resume Next
    rst.Close
    Set rst = Nothing
    Set cnn = Nothing
    End Sub</pre>


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

    Re: Form's Text Box Doesn't Update Table (2003)

    Try adding this line to Form_Current:

    Me.ap = DLookup("Vap_MIL_PREC", "PortVap", "Giorno = #" & Format(Me.Giorno, "mm/dd/yyyy") & "#")

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form's Text Box Doesn't Update Table (2003)

    Perfect as usual. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Thank you Hans. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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