Refreshing Data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • magmike

    Refreshing Data

    I have a contact form that once the contact information is filled out,
    a button is pressed by the user to pull up another form that schedules
    a call back date and time for that record. If you hit that button on
    a current record that already has a call back scheduled, it will show
    that information for that contact already in the form. If nothing is
    scheduled, the pull down box for that new record will be blank. Of
    course, the new record will not show up in the pull down box unless I
    hit the refresh button on the first form (contact) first before
    hitting the call back button. So, if you're still with me, what I am
    attempting to do is cause a refresh of the first form while invoking
    the call back button (so the new contact will appear in the drop down
    box without seperately hitting the refresh button), and/or if possible
    when clicking on the call back button, having a new call back record
    created, with the current (new) contact already selected in the
    contact drop down box. Here is my current code for the button:

    Private Sub Calls_Click()
    On Error GoTo Err_Calls_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "CallsForm"

    stLinkCriteria = "[Company]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_Calls_Clic k:
    Exit Sub

    Err_Calls_Click :
    MsgBox Err.Description
    Resume Exit_Calls_Clic k

    End Sub

  • tina

    #2
    Re: Refreshing Data

    well, if i understand you correctly, the combo box you're concerned with is
    on the second form, not the first form. sounds to me like you just need to
    write the first form's record to disk before calling the second form. try
    the following, as

    Private Sub Calls_Click()
    On Error GoTo Err_Calls_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    If Me.Dirty Then Me.Dirty = False
    stDocName = "CallsForm"
    stLinkCriteria = "[Company]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_Calls_Clic k:
    Exit Sub

    Err_Calls_Click :
    MsgBox Err.Description
    Resume Exit_Calls_Clic k

    End Sub

    hth


    "magmike" <magmike7@yahoo .comwrote in message
    news:1187036999 .305908.309090@ g4g2000hsf.goog legroups.com...
    I have a contact form that once the contact information is filled out,
    a button is pressed by the user to pull up another form that schedules
    a call back date and time for that record. If you hit that button on
    a current record that already has a call back scheduled, it will show
    that information for that contact already in the form. If nothing is
    scheduled, the pull down box for that new record will be blank. Of
    course, the new record will not show up in the pull down box unless I
    hit the refresh button on the first form (contact) first before
    hitting the call back button. So, if you're still with me, what I am
    attempting to do is cause a refresh of the first form while invoking
    the call back button (so the new contact will appear in the drop down
    box without seperately hitting the refresh button), and/or if possible
    when clicking on the call back button, having a new call back record
    created, with the current (new) contact already selected in the
    contact drop down box. Here is my current code for the button:
    >
    Private Sub Calls_Click()
    On Error GoTo Err_Calls_Click
    >
    Dim stDocName As String
    Dim stLinkCriteria As String
    >
    stDocName = "CallsForm"
    >
    stLinkCriteria = "[Company]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    >
    Exit_Calls_Clic k:
    Exit Sub
    >
    Err_Calls_Click :
    MsgBox Err.Description
    Resume Exit_Calls_Clic k
    >
    End Sub
    >

    Comment

    • Bob Quintal

      #3
      Re: Refreshing Data

      magmike <magmike7@yahoo .comwrote in
      news:1187036999 .305908.309090@ g4g2000hsf.goog legroups.com:
      I have a contact form that once the contact information is
      filled out, a button is pressed by the user to pull up another
      form that schedules a call back date and time for that record.
      If you hit that button on a current record that already has a
      call back scheduled, it will show that information for that
      contact already in the form. If nothing is scheduled, the pull
      down box for that new record will be blank. Of course, the new
      record will not show up in the pull down box unless I hit the
      refresh button on the first form (contact) first before
      hitting the call back button. So, if you're still with me,
      what I am attempting to do is cause a refresh of the first
      form while invoking the call back button (so the new contact
      will appear in the drop down box without seperately hitting
      the refresh button), and/or if possible when clicking on the
      call back button, having a new call back record created, with
      the current (new) contact already selected in the contact drop
      down box. Here is my current code for the button:
      >
      add a line of code to save the new/changed record before opening
      the form
      Private Sub Calls_Click()
      On Error GoTo Err_Calls_Click
      if Me.Dirty = True then Me Dirty = False 'forces save of record,
      >
      Dim stDocName As String
      Dim stLinkCriteria As String
      >
      stDocName = "CallsForm"
      >
      stLinkCriteria = "[Company]=" & Me![ID]
      DoCmd.OpenForm stDocName, , , stLinkCriteria
      >
      Exit_Calls_Clic k:
      Exit Sub
      >
      Err_Calls_Click :
      MsgBox Err.Description
      Resume Exit_Calls_Clic k
      >
      End Sub
      >
      >


      --
      Bob Quintal

      PA is y I've altered my email address.

      --
      Posted via a free Usenet account from http://www.teranews.com

      Comment

      • magmike

        #4
        Re: Refreshing Data

        On Aug 13, 10:55 pm, "tina" <nos...@address .comwrote:
        well, if i understand you correctly, the combo box you're concerned with is
        on the second form, not the first form. sounds to me like you just need to
        write the first form's record to disk before calling the second form. try
        the following, as
        >
        Private Sub Calls_Click()
        On Error GoTo Err_Calls_Click
        >
        Dim stDocName As String
        Dim stLinkCriteria As String
        >
        If Me.Dirty Then Me.Dirty = False
        stDocName = "CallsForm"
        stLinkCriteria = "[Company]=" & Me![ID]
        DoCmd.OpenForm stDocName, , , stLinkCriteria
        >
        Exit_Calls_Clic k:
        Exit Sub
        >
        Err_Calls_Click :
        MsgBox Err.Description
        Resume Exit_Calls_Clic k
        >
        End Sub
        >
        hth
        >
        "magmike" <magmi...@yahoo .comwrote in message
        >
        news:1187036999 .305908.309090@ g4g2000hsf.goog legroups.com...
        >
        >
        >
        I have a contact form that once the contact information is filled out,
        a button is pressed by the user to pull up another form that schedules
        a call back date and time for that record. If you hit that button on
        a current record that already has a call back scheduled, it will show
        that information for that contact already in the form. If nothing is
        scheduled, the pull down box for that new record will be blank. Of
        course, the new record will not show up in the pull down box unless I
        hit the refresh button on the first form (contact) first before
        hitting the call back button. So, if you're still with me, what I am
        attempting to do is cause a refresh of the first form while invoking
        the call back button (so the new contact will appear in the drop down
        box without seperately hitting the refresh button), and/or if possible
        when clicking on the call back button, having a new call back record
        created, with the current (new) contact already selected in the
        contact drop down box. Here is my current code for the button:
        >
        Private Sub Calls_Click()
        On Error GoTo Err_Calls_Click
        >
        Dim stDocName As String
        Dim stLinkCriteria As String
        >
        stDocName = "CallsForm"
        >
        stLinkCriteria = "[Company]=" & Me![ID]
        DoCmd.OpenForm stDocName, , , stLinkCriteria
        >
        Exit_Calls_Clic k:
        Exit Sub
        >
        Err_Calls_Click :
        MsgBox Err.Description
        Resume Exit_Calls_Clic k
        >
        End Sub- Hide quoted text -
        >
        - Show quoted text -
        That's awesome, thanks!

        Comment

        • tina

          #5
          Re: Refreshing Data

          you're welcome :)


          "magmike" <magmike7@yahoo .comwrote in message
          news:1187187375 .183136.146460@ 50g2000hsm.goog legroups.com...
          On Aug 13, 10:55 pm, "tina" <nos...@address .comwrote:
          well, if i understand you correctly, the combo box you're concerned with
          is
          on the second form, not the first form. sounds to me like you just need
          to
          write the first form's record to disk before calling the second form.
          try
          the following, as

          Private Sub Calls_Click()
          On Error GoTo Err_Calls_Click

          Dim stDocName As String
          Dim stLinkCriteria As String

          If Me.Dirty Then Me.Dirty = False
          stDocName = "CallsForm"
          stLinkCriteria = "[Company]=" & Me![ID]
          DoCmd.OpenForm stDocName, , , stLinkCriteria

          Exit_Calls_Clic k:
          Exit Sub

          Err_Calls_Click :
          MsgBox Err.Description
          Resume Exit_Calls_Clic k

          End Sub

          hth

          "magmike" <magmi...@yahoo .comwrote in message

          news:1187036999 .305908.309090@ g4g2000hsf.goog legroups.com...


          I have a contact form that once the contact information is filled out,
          a button is pressed by the user to pull up another form that schedules
          a call back date and time for that record. If you hit that button on
          a current record that already has a call back scheduled, it will show
          that information for that contact already in the form. If nothing is
          scheduled, the pull down box for that new record will be blank. Of
          course, the new record will not show up in the pull down box unless I
          hit the refresh button on the first form (contact) first before
          hitting the call back button. So, if you're still with me, what I am
          attempting to do is cause a refresh of the first form while invoking
          the call back button (so the new contact will appear in the drop down
          box without seperately hitting the refresh button), and/or if possible
          when clicking on the call back button, having a new call back record
          created, with the current (new) contact already selected in the
          contact drop down box. Here is my current code for the button:
          Private Sub Calls_Click()
          On Error GoTo Err_Calls_Click
          Dim stDocName As String
          Dim stLinkCriteria As String
          stDocName = "CallsForm"
          stLinkCriteria = "[Company]=" & Me![ID]
          DoCmd.OpenForm stDocName, , , stLinkCriteria
          Exit_Calls_Clic k:
          Exit Sub
          Err_Calls_Click :
          MsgBox Err.Description
          Resume Exit_Calls_Clic k
          End Sub- Hide quoted text -
          - Show quoted text -
          >
          That's awesome, thanks!
          >

          Comment

          Working...