Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pushing Data (Access 2000)

    Hello,
    I have a question about pushing data into bound controls. I have a form with two combo boxes and 4 or 5 text boxes. In one of the combo boxes I would like for the user to be able to select a record and when the record is selected for it to fill in a related field in one of the text boxes. For example the combo box is named cboProjectName and the text box is named txtProjectNumber. Now this would be very easily acomplished by pulling data into the controls but I would like to store the values that appear in the two controls in a table. Now the question: Is there anyway to push data into a control and store the values in a table? Any help is very much appreciated.

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

    Re: Pushing Data (Access 2000)

    If you bind the controls to fields in the record source of the form, the value put into the controls will be saved to the underlying table automatically. You could set the value of the controls in the After Update event of the relevant combo box.

  3. #3
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pushing Data (Access 2000)

    Mr. V,
    Could you possibly point me to or show me some code that does what you describe. Today I seem to be very ignorant and could use some help.

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

    Re: Pushing Data (Access 2000)

    Could you provide some details about the situation? When the user selects an item in one of the combo boxes, where do the values for the text boxes come from? Are they available in invisible columns of the combo box, or should they be looked up in a table, or ...?

  5. #5
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pushing Data (Access 2000)

    Mr. v,
    First off I want you to know I appreciate all of your help. As far as the situation I'm in now, I would like the values in the text box to be filled by a table. The combo box has the project name and the text box would then be filled with the related project number. Thanks again for all of your help.

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

    Re: Pushing Data (Access 2000)

    For example:

    Private Sub cboProjectName_AfterUpdate()
    Me.txtProjectNo = DLookup("[ProjectNo]", "tblProjects", _
    "[ProjectName] = " & Chr(34) & Me.cboProjectName & Chr(34))
    End Sub

    Of course, you must substitute the correct names.

  7. #7
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pushing Data (Access 2000)

    Mr. V,
    Just as I thought your the man with the answers. Thank you and have a wonderful weekend.

Posting Permissions

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